一、查看当前Ubuntu代号
lsb_release -a
二、备份原来的源
cp -ra /etc/apt/sources.list /etc/apt/sources.list.bak
三、更换源
sudo vi /etc/apt/sources.list
将sources.list中的内容替换,其中focal字符串根据自己Ubuntu代号更改
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
四、更新软件列表和软件
sudo apt-get update #更新软件列表 sudo apt-get upgrade #更新软件
Ubuntu更换阿里源
最新推荐文章于 2024-01-03 16:05:42 发布