Ubuntu更改apt源为阿里云源

编辑源列表文件

$ vim /etc/apt/sources.list

查看新版本信息

$ lsb_release -c

ubuntu版本的系统代号

Ubuntu 12.04 (LTS)代号为precise

Ubuntu 14.04 (LTS)代号为trusty

Ubuntu 15.04 代号为vivid

Ubuntu 15.10 代号为wily

Ubuntu 16.04 (LTS)代号为xenial

将原有的内容注释掉,添加以下内容(或者你把里面内容修改成下面的就可以,但是不能有除了以下内容的有效内容)

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

ps.知道我为什么说版本号吗?只要把我的版本号bionic改成你的版本号就能用了

#更新软件列表
$ sudo apt-get update

#更新软件包
$ sudo apt-get upgrade

 

posted @ 2021-01-02 23:56  lgp20151222  阅读(302)  评论(0编辑  收藏  举报