Ubuntu-apt更换为阿里源

使用Linux的Ubuntu时会很卡,需要更换为阿里源或其他公司的源
步骤:

编辑/etc/apt/sources.list文件

可以使用vi,gedit,小白用gedit会好一点
先备份一个文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.back
修改内容
sudo gedit /etc/apt/sources.list
替换为

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

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

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

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

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

然后更新apt使其生效
apt-get update
附:
阿里镜像站

猜你喜欢

转载自blog.csdn.net/weixin_44494373/article/details/110652692
今日推荐