1、备份源文件
cp /etc/apt/sources.list /etc/apt/sources.list_bak
2、清空源文件
echo "" > /etc/apt/sources.list
3、换源
编辑文件
vi /etc/apt/sources.list
将下面阿里云的源 复制到文件中
# 阿里云源文件
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
4、更新缓存
#先清理缓存
sudo apt-get autoclean
#更新缓存
apt update
#软件包升级到最新版本
apt upgrade