ubuntu 修改安装源
时间: 2023-11-28 22:04:23 浏览: 72
您可以使用以下命令将 Ubuntu 的软件更新源更改为国内的镜像源:
1.备份您的源列表文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
2.打开源列表文件
sudo nano /etc/apt/sources.list
3.将其中的内容全部注释掉,然后将下面的内容复制进去:
#阿里云
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
4.保存并退出文件
Ctrl + O
Ctrl + X
5.更新源列表
sudo apt update
现在您已经成功更改了Ubuntu的软件更新源为阿里云镜像源。
阅读全文