1. 先将默认的软件源备份
sudo cp /etc/apt/sources.list/etc/apt/sources.list.bak
2. 更换软件源
sudo gedit/etc/apt/sources.list
将以下内容覆盖原来的
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释deb https://mirrors.tuna./ubuntu/ focal main restricted universe multiverse# deb-src https://mirrors.tuna./ubuntu/ focal main restricted universe multiversedeb https://mirrors.tuna./ubuntu/ focal-updates main restricted universe multiverse# deb-src https://mirrors.tuna./ubuntu/ focal-updates main restricted universe multiversedeb https://mirrors.tuna./ubuntu/ focal-backports main restricted universe multiverse# deb-src https://mirrors.tuna./ubuntu/ focal-backports main restricted universe multiversedeb https://mirrors.tuna./ubuntu/ focal-security main restricted universe multiverse# deb-src https://mirrors.tuna./ubuntu/ focal-security main restricted universe multiverse# 预发布软件源,不建议启用# deb https://mirrors.tuna./ubuntu/ focal-proposed main restricted universe multiverse# deb-src https://mirrors.tuna./ubuntu/ focal-proposed main restricted universe multiverse
或者用阿里云的
deb /ubuntu/ bionic main restricted universe multiversedeb /ubuntu/ bionic-security main restricted universe multiversedeb /ubuntu/ bionic-updates main restricted universe multiversedeb /ubuntu/ bionic-proposed main restricted universe multiversedeb /ubuntu/ bionic-backports main restricted universe multiversedeb-src /ubuntu/ bionic main restricted universe multiversedeb-src /ubuntu/ bionic-security main restricted universe multiversedeb-src /ubuntu/ bionic-updates main restricted universe multiversedeb-src /ubuntu/ bionic-proposed main restricted universe multiversedeb-src /ubuntu/ bionic-backports main restricted universe multiverse
3. 更新源和软件
sudo apt-get update //更新源
sudo apt-get upgrade //更新软件