1.先备份sources.list文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
2.换源
LUG's repo file generator 用这个网址!因为不同的ubuntu版本对应的源的版本是不一样的!比如ubuntu22.04对应的是“jammy”,ubutnu20.04对应的是“focal”
deb https://mirrors.ustc.edu.cn/ubuntu/ mantic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ mantic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ mantic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ mantic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ mantic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ mantic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ mantic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ mantic-backports main restricted universe multiverse
把sources.list文件里的内容改为上面的条目
3.更新源和软件
sudo apt-get update
sudo apt-get upgrade