Ubuntu16.04更换阿里云apt-get软件源

前端之家收集整理的这篇文章主要介绍了Ubuntu16.04更换阿里云apt-get软件源前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1. 备份源文件

进入源文件sources.list所在的目录,对源文件进行备份,以防万一

# cd /etc/apt/

# cp sources.list sources.list.bak

2. 修改文件内容

阿里云软件源的文件内容如下:

#deb包

deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse 

##测试版源 

deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse  

# 源码 

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

##测试版源 

deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse  

# Canonical 合作伙伴和附加 

删除旧的sources.list,新建一个sources.list文件

# cd /etc/apt/

# rm sources.list

# touch sources.list

全部复制上述的阿里云源文件内容,把内容粘贴到sources.list文件中,输入:wq保存退出

3. 更新源和软件

更新获取阿里云软件源的软件列表

# apt-get update

更新软件

# apt-get upgrade

4. 参考文件

https://blog.csdn.net/ezreal_king/article/details/72790291

原文链接:https://www.f2er.com/ubuntu/349718.html

猜你在找的Ubuntu相关文章