更改ubuntu的apt源到阿里云

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

sudo vi /etc/apt/sources.list

把下面内容拷贝到sources.list进行保存:

=============================================================

ubuntu 12.04的源:

deb http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse 
deb http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse 
deb http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse 
deb http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse 
deb http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse

===============================================================

ubuntu 14.04的源:

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

===============================================================

ubuntu 18.04的源:

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

=============================================================================

然后运行sudo apt-get update

猜你喜欢

转载自blog.csdn.net/lihewei126/article/details/82827438