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
相关推荐
豆是浪个1 小时前
Linux(Centos 7.6)命令详解:ps
linux·windows·centos
乾元1 小时前
ISP 级别的异常洪泛检测与防护——大流量事件的 AI 自动识别与响应工程
运维·网络·人工智能·安全·web安全·架构
编程武士1 小时前
开源项目 osv-scanner:谷歌出品的依赖漏洞扫描工具
开源
Run_Teenage2 小时前
Linux:深刻理解缓冲区
linux
知识分享小能手2 小时前
Ubuntu入门学习教程,从入门到精通,Ubuntu 22.04中的Java与Android开发环境 (20)
java·学习·ubuntu
youxiao_902 小时前
kubernetes 概念与安装(一)
linux·运维·服务器
凡梦千华2 小时前
logrotate日志切割
linux·运维·服务器
wdfk_prog2 小时前
[Linux]学习笔记系列 -- [fs][proc]
linux·笔记·学习
ELI_He9993 小时前
Airflow docker 部署
运维·docker·容器
拜托啦!狮子3 小时前
安装和使用Homer(linux)
linux·运维·服务器