修改 Ubuntu 镜像源
· 阅读需 1 分钟
-
首先确定 Ubuntu 版本代号:
lsb_release -c常见的版本代号:
- 16.04 xenial
- 18.04 bionic
- 20.04 focal
- 22.04 jammy
- 24.04 noble
-
备份原有的源文件:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak -
修改源文件:
sudo vim /etc/apt/sources.list将文件内容替换为以下内容:
# 中科大镜像源
deb https://mirrors.ustc.edu.cn/ubuntu/ noble main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ noble-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ noble-security main restricted universe multiverse其中
noble为 Ubuntu 版本代号,根据实际情况替换。 -
更新源:
sudo apt update