码迷,mamicode.com
首页 > 其他好文 > 详细

ubantu学习之更改apt源

时间:2019-04-06 12:32:18      阅读:135      评论:0      收藏:0      [点我收藏+]

标签:res   nic   apt-get   ade   aliyun   阿里   ict   pre   code   

1.获取版本codename

sudo lsb_release -a

2.确认阿里源支持

传送门地址
注:该网页提供了阿里云支持的ubuntu系统下各个Codename版本

3.备份系统源文件

sudo cp /etc/apt/sources.list    /etc/apt/sources.list.bak

4.将阿里云源提供的源里的bionic替换成自己版本的codename,下面提供脚本,复制运行即可

Codename=$( (lsb_release -a)|awk '{print $2}'|tail -n 1 )
echo "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 " >sources.list

5.更新源索引

sudo  apt-get update

6.更新软件升级

sudo apt-get upgrade

ubantu学习之更改apt源

标签:res   nic   apt-get   ade   aliyun   阿里   ict   pre   code   

原文地址:https://www.cnblogs.com/sunxiuwen/p/10661214.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!