首先备份一下原来的
cp /etc/apt/ /etc/apt/
然后修改
sudo vi /etc/apt/
然后根据你的版本将中的内容换成相应的内容
Ubuntu 22.04 LTS 阿里源
deb /ubuntu/ jammy main restricted universe multiverse
deb-src /ubuntu/ jammy main restricted universe multiverse
deb /ubuntu/ jammy-security main restricted universe multiverse
deb-src /ubuntu/ jammy-security main restricted universe multiverse
deb /ubuntu/ jammy-updates main restricted universe multiverse
deb-src /ubuntu/ jammy-updates main restricted universe multiverse
deb /ubuntu/ jammy-proposed main restricted universe multiverse
deb-src /ubuntu/ jammy-proposed main restricted universe multiverse
deb /ubuntu/ jammy-backports main restricted universe multiverse
deb-src /ubuntu/ jammy-backports main restricted universe multiverse
ubuntu 22.04 清华源
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb /ubuntu/ jammy main restricted universe multiverse
# deb-src /ubuntu/ jammy main restricted universe multiverse
deb /ubuntu/ jammy-updates main restricted universe multiverse
# deb-src /ubuntu/ jammy-updates main restricted universe multiverse
deb /ubuntu/ jammy-backports main restricted universe multiverse
# deb-src /ubuntu/ jammy-backports main restricted universe multiverse
deb /ubuntu/ jammy-security main restricted universe multiverse
# deb-src /ubuntu/ jammy-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb /ubuntu/ jammy-proposed main restricted universe multiverse
# deb-src /ubuntu/ jammy-proposed main restricted universe multiverse
ubuntu 22.04 中科大源
deb /ubuntu/ jammy main restricted universe multiverse
deb-src /ubuntu/ jammy main restricted universe multiverse
deb /ubuntu/ jammy-updates main restricted universe multiverse
deb-src /ubuntu/ jammy-updates main restricted universe multiverse
deb /ubuntu/ jammy-backports main restricted universe multiverse
deb-src /ubuntu/ jammy-backports main restricted universe multiverse
deb /ubuntu/ jammy-security main restricted universe multiverse
deb-src /ubuntu/ jammy-security main restricted universe multiverse
deb /ubuntu/ jammy-proposed main restricted universe multiverse
deb-src /ubuntu/ jammy-proposed main restricted universe multiverse
ubuntu 22.04 163源
deb http://mirrors./ubuntu/ jammy main restricted universe multiverse
deb http://mirrors./ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors./ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors./ubuntu/ jammy-proposed main restricted universe multiverse
deb http://mirrors./ubuntu/ jammy-backports main restricted universe multiverse
deb-src http://mirrors./ubuntu/ jammy main restricted universe multiverse
deb-src http://mirrors./ubuntu/ jammy-security main restricted universe multiverse
deb-src http://mirrors./ubuntu/ jammy-updates main restricted universe multiverse
deb-src http://mirrors./ubuntu/ jammy-proposed main restricted universe multiverse
deb-src http://mirrors./ubuntu/ jammy-backports main restricted universe multiverse
最后更新一下
sudo apt-get update