Ubuntu更换阿里源
1. 首先查看自己的ubuntu系统的codename,这一步很重要,直接导致你更新的源是否对你的系统起效果,查看方法:
lsb_release -a
如,我的系统显示:
Description: Ubuntu 17.04
Release: 17.04
Codename: zesty
2. 确认阿里源支持:
登陆以下网页:http://mirrors.aliyun.com/ubuntu/dists/
该网页显示了阿里云支持的ubuntu系统下各个Codename版本,确保自己的Codename在该网页中存在(一般都会有的)
2. 备份系统源:
cd /etc/apt/
sudo cp sources.list sources.list.bak
3. 添加新的源:
sudo gedit sources.list
用以下内容替换文件,所有zesty应该用第一步查看得到的Codename来代替
deb http://mirrors.aliyun.com/ubuntu/ zesty main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ zesty-backports main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ zesty-proposed main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ zesty-security main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ zesty-updates main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ zesty main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ zesty-backports main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ zesty-proposed main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ zesty-security main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ zesty-updates main multiverse restricted universe
4. 保存并且sudo apt-get update,更新成功