Ubuntu24.04设置国内镜像软件源

参考文章:

Ubuntu24.04更换源地址(新版源更换方式) - 陌路寒暄

一、禁用原来的软件源

Ubuntu24.04 的源地址配置文件发生改变,不再使用以前的 sources.list 文件,升级 24.04 之后,该文件内容变成了一行注释:

Ubuntu sources have moved to /etc/apt/sources.list.d/ubuntu.sources

新的官方源配置放在了/etc/apt/sources.list.d/ubuntu.sources 中, 升级前的三方源被放在了/etc/apt/sources.list.d/third-party.sources 中。

首先修改 sources.list.d/ubuntu.sources,添加 Enabled: no 进行禁用:

二、修改 sources.list.d/third-party.sources 文件,填入国内源地址

R 复制代码
#腾讯源
Enabled: yes
Types: deb
URIs: http://mirrors.tencent.com/ubuntu/
Suites: noble noble-updates noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg


#清华源
Enabled: yes
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


#阿里源
Enabled: yes
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

三、更新软件源 和 升级软件包

在终端输入:

bash 复制代码
yammie@my-pc >/home/yammie
$ sudo apt-get update
bash 复制代码
yammie@my-pc >/home/yammie
$ sudo apt-get upgrade
相关推荐
厨 神6 分钟前
vmware中的ubuntu系统扩容分区
linux·运维·ubuntu
Karoku06610 分钟前
【网站架构部署与优化】web服务与http协议
linux·运维·服务器·数据库·http·架构
geek_Chen0112 分钟前
虚拟机共享文件夹开启后mnt/hgfs/下无sharefiles? --已解决
linux·运维·服务器
(⊙o⊙)~哦43 分钟前
linux 解压缩
linux·运维·服务器
牧小七2 小时前
Linux命令---查看端口是否被占用
linux
最新小梦2 小时前
Docker日志管理
运维·docker·容器
鸡鸭扣3 小时前
虚拟机:3、(待更)WSL2安装Ubuntu系统+实现GPU直通
linux·运维·ubuntu
友友马3 小时前
『 Linux 』HTTP(一)
linux·运维·服务器·网络·c++·tcp/ip·http
千禧年@3 小时前
微服务以及注册中心
java·运维·微服务
记得开心一点嘛4 小时前
在Linux系统上使用Docker部署javaweb项目
linux·运维·docker