ubuntu更换阿里源

听天大帝 2020-03-26

ubuntu aliyun update list

一、查看ubuntu的Codename

lsb_release -a | grep Codename | awk '{print $2}' # 输出结果为下文中的Codename

2020_03_26_00_27_07_

二、备份系统源

cd /etc/apt
sudo mv sources.list sources.list.bak

三、写入阿里云的源

vi sources.list

下面源信息中$Codename为第一步中系统的Codename,用记事本批量替换即可。

deb http://mirrors.aliyun.com/ubuntu/ $Codename main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ $Codename-backports main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ $Codename-proposed main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ $Codename-security main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ $Codename-updates main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ $Codename main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-backports main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-proposed main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-security main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-updates main multiverse restricted universe

四、执行更新

apt-get update
备注:可以通过http://mirrors.aliyun.com/ubuntu/dists/网站查看是否支持当前系统的Codename。

登录 后评论
下一篇
云栖号资讯小编
1506人浏览
2020-05-25
相关推荐
Ubuntu更换阿里云软件源
36633人浏览
2019-06-05 13:32:11
Ubuntu 14.04 更换阿里云源
5513人浏览
2018-10-10 09:54:19
ubuntu更换阿里源实践
2203人浏览
2019-04-23 15:18:29
0
0
0
1829