Ubuntu国内镜像源更新
时间: 2023-11-14 08:39:52 浏览: 74
1. 打开终端,输入如下命令:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
2. 备份原有源文件,输入密码
3. 编辑源文件,输入如下命令:
sudo gedit /etc/apt/sources.list
或者
sudo nano /etc/apt/sources.list
4. 将原有源文件中的内容全部删除,然后复制以下内容并粘贴到文件中保存
#阿里云源
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
5. 执行更新命令
sudo apt-get update
6. 更新软件
sudo apt-get upgrade
7. 安装新软件
sudo apt-get install 软件名称
8. 如果出现以下提示信息
可能要运行 apt --fix-broken install 以修复它。
则输入以下命令解决
sudo apt --fix-broken install
9. 更新完成。