Linux软件之如何更换软件源?(阿里源)(Ubuntu 16.04)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/baidu_34122324/article/details/84343164


1. 找到并备份配置文件sources.list

我们需要对apt源的配置文件进行修改 。进入/etc/apt目录,我们可以看到sources.list文件。

为了保证安全,我们在修改前先把sources.list文件进行备份

$ sudo cp sources.list sources.list.bak

2. 修改配置文件sources.list

建议先安装vim编辑工具,因为自带的vi特别难用,vim是vi的增强版。

$ sudo apt-get install vim

vi或者vim操作sources.list文件,先清空原有的内容(官方源)。然后再把下面的阿里源复制进去。

阿里源Ubunt16.04(xenial)版本

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 
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe 
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 
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 
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse

3. 更新源 + 更新软件

3.1 更新源

$ sudo apt-get update

3.2 更新软件

$ sudo apt-get upgrade
展开阅读全文

没有更多推荐了,返回首页