Ubuntu apt更换为阿里源

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

apt源配置在 /etc/apt/sources.list ,首先备份一下:

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

然后修改sources.list为:

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

注意:上面的内容中xenial 是我的ubuntu的版本号,你要替换成你的版本号。查看版本号方法为:

lsb_release -c

如:
在这里插入图片描述

最后更新一下软件列表

sudo apt-get update

猜你喜欢

转载自blog.csdn.net/u010837612/article/details/86680119
今日推荐