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