- 备份
/etc/apt/sources.list
文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
- 编辑
/etc/apt/sources.list
文件, 我用的nano
,也可以用别的编辑器编辑,比如vim
sudo nano /etc/apt/sources.list
- 在文件前面添加下面的条目(阿里源)
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
- 更新
sudo apt-get update
如果如出现依赖问题
sudo apt-get -f install
网友评论