Ubuntu22.04更换阿里镜像源
本文最后更新于 2024-11-06,文章内容可能已经过时。
在Ubuntu 22.04中更换镜像源可以通过编辑 /etc/apt/sources.list
文件来实现。以下是更换为阿里云镜像源的步骤:
-
备份当前的
sources.list
文件:sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
-
编辑
sources.list
文件:sudo nano /etc/apt/sources.list
-
将文件中的内容替换为阿里云的镜像源(以Ubuntu 22.04为例):
deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
-
ctrl+x 保存并关闭文件
-
更新软件源:
sudo apt update
-
升级已安装的包:
sudo apt upgrade
以上步骤将会将系统的软件源更换为阿里云的镜像源,提供更快的软件包下载速度。
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 Xiaohao
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果