Welcome

首页 / 操作系统 / Linux / Ubuntu24.04更换国内源

Ubuntu24.04更换国内源


打开终端,输入以下命令,备份当前的源列表:

sudo cp /etc/apt/sources.list.d/ubuntu.sources  /etc/apt/sources.list.d/ubuntu.sources.bak

打开文本编辑器,输入以下命令:

sudo vim /etc/apt/sources.list.d/ubuntu.sources

在文本编辑器中粘贴以下内容:

# 阿里云
Types: deb
URIs: http://mirrors.aliyun.com/ubuntu/
Suites: noble noble-updates noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

保存并关闭文本编辑器。

更新源列表,输入以下命令:

sudo apt-get update
sudo apt-get upgrade

还可以使用其它源:

# 清华源
Types: deb
URIs: http://mirrors.tuna.tsinghua.edu.cn/ubuntu/
Suites: noble noble-updates noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
#中科大源
Types: deb
URIs: http://mirrors.ustc.edu.cn/ubuntu/
Suites: noble noble-updates noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
#网易163源
Types: deb
URIs: http://mirrors.163.com/ubuntu/
Suites: noble noble-updates noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

整理好的源文件下载:ubuntu.sources