Ubuntu24.04LTS 更新清华源
- 备份原有的源列表文件(/etc/apt/sources.list.d/ubuntu.sources 备份为 /etc/apt/sources.list.d/ubuntu.sources.bak)
$ sudo cp /etc/apt/sources.list.d/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources.bak
- 编辑源列表文件(/etc/apt/sources.list.d/ubuntu.sources)
$ sudo nano /etc/apt/sources.list.d/ubuntu.sources
- 修改前(修改第二行 URIs:...)
Types: deb
URIs: http://archive.ubuntu.com/ubuntu/
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
- 修改后(把 URIs: 后面的替换为:https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ 清华的源)
Types: deb
URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu/
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
- 保存退出后,运行
$ sudo apt update -y && sudo apt upgrade -y
完成