ubuntu modify the apt-get source for domestic mirror source

1, the original file backup
 
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
 
2, edit the source file list
 
sudo vim /etc/apt/sources.list
 
3, delete the original list, add the following
 
(DG Delete to end of the text
d1G to delete the text of the first)
 
Ali cloud sources
deb http://mirrors.aliyun.com/ubuntu/ great main
deb-src http://mirrors.aliyun.com/ubuntu/ great main
 
deb http://mirrors.aliyun.com/ubuntu/ great-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ great-updates main
 
deb http://mirrors.aliyun.com/ubuntu/ great universe
deb-src http://mirrors.aliyun.com/ubuntu/ great universe
deb http://mirrors.aliyun.com/ubuntu/ great-updates universe
deb-src-updates http://mirrors.aliyun.com/ubuntu/ great universe
 
deb http://mirrors.aliyun.com/ubuntu/ great-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ great-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
 
4、更新源
 
更新软件包列表
sudo apt-get update
 
休复损坏的软件包,尝试卸载出错的包,重新安装正确版本的。
sudo apt-get -f install
 
升级系统中的所有软件包
sudo apt-get -y upgrade

Guess you like

Origin www.cnblogs.com/jylee/p/10955457.html