ubuntu18.04换源
时间: 2023-04-01 14:04:14 浏览: 75
Ubuntu 18.04更换apt-get源的方法
你可以使用以下命令将 Ubuntu 18.04 的软件源更换为国内镜像源:
1.备份原有源列表
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
2.编辑源列表文件
sudo gedit /etc/apt/sources.list
3.将原有源列表中的内容全部删除,替换为以下内容:
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
4.更新源列表
sudo apt-get update
5.升级软件包
sudo apt-get upgrade
希望对你有所帮助。
阅读全文