Ubuntu14.04更换阿里云源

步骤很简单一共三步,如下所示:

第一、备份源文件(防止万一)

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

 

第二、修改源文件(这里的源文件是你通过vim新建的源文件)

sudo vim /etc/apt/sources.list

sources.list添加如下内容:

deb-src http://archive.ubuntu.com/ubuntu xenial main restricted
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse

 

第三、更新

sudo apt-get update

 

只要第三步没有出问题,表示你已经成功更新阿里云源成功了。

其实之所以用阿里云源,主要是考虑下载速度方面,阿里云在国内的CDN节点很多,自然下载速度快。从另外一个方面我顺便说说为什么大中型企业为什么要构建自己的maven私服,原因有二,第一,下载速度快;第二,更好管理和迭代版本。比如现在很多公司基本上都使用阿里云的maven仓库。

 

国内几个更新源可以参考:http://www.cnblogs.com/bovenson/p/5752213.html

posted @ 2018-12-10 20:44  挑战者V  阅读(1718)  评论(0编辑  收藏  举报