文章目录
- [1 备份原文件](#1 备份原文件)
- [2 修改文件内容](#2 修改文件内容)
Ubuntu2404修改国内镜像
2404和2204修改镜像的方式不一致
且镜像保存的位置也不一致,位置在/etc/apt/source.list.d/ubuntu.sources
参考:https://blog.csdn.net/Kiffy_Yam/article/details/145876447
1 备份原文件
shell
sudo cp /etc/apt/source.list.d/ubuntu.sources /etc/apt/source.list.d/ubuntu.sources.bak
2 修改文件内容
shell
sudo vim /etc/apt/source.list.d/ubuntu.sources
修改内容为
shell
Types: deb
URIs: https://mirrors.aliyun.com/ubuntu/
Suites: noble noble-security noble-updates noble-proposed noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# 以下内容注释
## Ubuntu security updates. Aside from URIs and Suites,
## this should mirror your choices in the previous section.
# Types: deb
# URIs: http://security.ubuntu.com/ubuntu/
# Suites: noble-security
# Components: main universe restricted multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
注意是 https
更新
shell
sudo apt update