0%

Ubuntu修改apt源

Ubuntu修改apt源

本地安装了一个Ubuntu系统,为了方便使用,把apt源替换为国内的阿里云的源地址

直接设置中去修改

打开SystemSettings,选择Software & Updates 选择中国的镜像就可以。

手动修改配置文件

手动修改配置文件并更新

备份原先的配置文件

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

修改配置文件

sudo vim /etc/apt/sources.list

删除里面的内容添加如下内容:

1
2
3
4
5
6
7
8
9
10
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

更新源

sudo apt-get update