Ubuntu 快速更换阿里源

Ubuntu 快速更换阿里源
镜像下载、域名解析、时间同步请点击 阿里巴巴开源镜像站

一、查看ubuntu的Codename

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

Ubuntu 快速更换阿里源

二、备份系统源

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。

阿里巴巴开源镜像站 提供全面,高效和稳定的系统镜像、应用软件下载、域名解析和时间同步服务。”

上一篇:学习Java8中Optional


下一篇:图解css3:核心技术与案例实战. 3.3 CSS3图片边框属性