Ubuntu 24.04 更改软件源
创始人
2025-07-10
0

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 举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。

上一篇:伪静态根目录直接跳转到子目录

下一篇:没有了

相关内容

热门资讯

SIOCADDRT: Netw... SIOCADDRT: Network is unreachable SIOCADDRT: 网络不可达...
centos7下创建新用户和组 linux下添加,删除,修改,查看用户和用户组 1 .增加一个test组 groupadd test...
linux通过sed 修改文件... 13sy.txt里面内容如下 A; B; C; write by luohao199621; 1.要...
关于cannot remove... 关于cannot remove directory: Directory not empty的解决办...
mount: unknown ... mount: unknown filesystem type LVM2_member解决方案 系统启...
OpenMediaVault安... OpenMediaVault 是一个基于Debian的专用 Linux 发行版,用于构建网络连接存储...
centos7 双网卡双网关的... 最近公司需要在一台服务器上同时使用内网和外网,并且都需要跨网段访问,因此需要双网关,但是一台机子上只...
ethtool 命令详解 1 概述 ethtool 是用于查询及设置网卡参数的命令。 2 命令详解 2.1 命令格式 (1) ...
CentOS7单网卡设置双IP... linux系统CentOS7单网卡设置双IP的方法,centos7.5、7.6、7.7设置双IP教程...
Linux进程状态D,S,Z的... Linux进程状态top,ps中看到进程状态D,S,Z的含义 在top和ps命令中有一列显示进程状态...