Ubuntu 24.04 版本更改软件源的方式有所变化,不再使用 sources.list 文件,而是改为使用 /etc/apt/sources.list.d/ubuntu.sources 配置文件。以下是更改为国内源的方式。
一、源文件位置
Ubuntu 24.04 采用新的源地址配置文件。升级到 24.04 之后,系统会使用以下文件来配置源:/etc/apt/sources.list.d/ubuntu.sources
二、开始更换源
1. 备份源配置文件
在进行任何更改之前,建议先备份当前的源配置文件:
sudo cp /etc/apt/sources.list.d/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources.bak
2. 编辑源配置文件
sudo vim /etc/apt/sources.list.d/ubuntu.sources
3.修改ubuntu.sources中对应源
## See the sources.list(5) manual page for further settings. Types: deb URIs: http://archive.ubuntu.com/ubuntu Suites: noble noble-updates noble-backports Components: main universe restricted 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
修改为
## See the sources.list(5) manual page for further settings. Types: deb URIs: https://mirrors.ustc.edu.cn/ubuntu/ Suites: noble noble-updates noble-backports Components: main universe restricted 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: https://mirrors.ustc.edu.cn/ubuntu/ Suites: noble-security Components: main universe restricted multiverse Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
4. 更新软件列表和软件
sudo apt-get update #看个人需求是否需要 sudo apt-get upgrade
注:目前更换的是科大的源,经过测试这个源速度最好,自己可以根据自己需要配置
ubuntu官方有推荐的源列表,有国家和带宽,可以参考下,选择适合自己的
https://launchpad.net/ubuntu/+archivemirrors
【版权声明】
本站部分内容来源于互联网,本站不拥有所有权,不承担相关法律责任。如果发现本站有侵权的内容,欢迎发送邮件至masing@13sy.com 举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。
上一篇:伪静态根目录直接跳转到子目录
下一篇:没有了