Ubuntu 26.04 更换阿里云源镜像

在 Ubuntu 24.04 及更高版本 (如 25.04)中,APT 软件源配置文件已从传统的 /etc/apt/sources.list 迁移到 /etc/apt/sources.list.d/ubuntu.sources,更换阿里云镜像需要直接修改该文件。

bash 复制代码
​
# -----------------------------------------------------
# - 🚀 Powered by Moshow郑锴
# - 🌟 Might the holy code be with you!
# -----------------------------------------------------
# 🔍 公众号 👉 软件开发大百科
# 💻 CSDN 👉 https://zhengkai.blog.csdn.net
# 📂 Github 👉 https://github.com/moshowgame

​

步骤 1:编辑源配置文件

在修改前备份原配置:

sudo cp /etc/apt/sources.list.d/ubuntu.sources ~/ubuntu.sources.bak

nano修改

sudo nano /etc/apt/sources.list.d/ubuntu.sources

步骤 2:替换为阿里云镜像地址

URIs: https://mirrors.aliyun.com/ubuntu/

bash 复制代码
moshow@moshow-ubuntu:~/Downloads$ sudo nano /etc/apt/sources.list.d/ubuntu.sources
moshow@moshow-ubuntu:~/Downloads$ cat /etc/apt/sources.list.d/ubuntu.sources
Types: deb
URIs: https://mirrors.aliyun.com/ubuntu/
Suites: resolute resolute-updates resolute-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

Types: deb
URIs: https://mirrors.aliyun.com/ubuntu/
Suites: resolute-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

步骤 3:更新软件包索引

sudo apt update

bash 复制代码
moshow@moshow-ubuntu:~/Downloads$ sudo apt update
[sudo: authenticate] 密码:          
获取:1 http://archive.ubuntu.com/ubuntu resolute InRelease [136 kB]
获取:2 http://archive.ubuntu.com/ubuntu resolute-updates InRelease [137 kB]
命中:3 http://archive.ubuntu.com/ubuntu resolute-backports InRelease
获取:4 http://archive.ubuntu.com/ubuntu resolute/main i386 Packages [1,069 kB]
获取:5 http://archive.ubuntu.com/ubuntu resolute/main amd64 Packages [1,480 kB]                                                
获取:6 http://security.ubuntu.com/ubuntu resolute-security InRelease [137 kB]                                                  
命中:7 https://esm.ubuntu.com/apps/ubuntu resolute-apps-security InRelease                                                     
命中:8 https://esm.ubuntu.com/infra/ubuntu resolute-infra-security InRelease                                                   
获取:9 http://security.ubuntu.com/ubuntu resolute-security/main i386 Packages [93.8 kB]                                        
获取:10 http://security.ubuntu.com/ubuntu resolute-security/main amd64 Packages [203 kB]                                       
获取:11 http://security.ubuntu.com/ubuntu resolute-security/main Translation-en [54.8 kB]                                      
获取:12 http://security.ubuntu.com/ubuntu resolute-security/main amd64 Components [31.1 kB]                                    
获取:13 http://security.ubuntu.com/ubuntu resolute-security/main Icons (48x48) [14.3 kB]                                       
获取:14 http://security.ubuntu.com/ubuntu resolute-security/main Icons (64x64) [20.3 kB]                                       
获取:15 http://security.ubuntu.com/ubuntu resolute-security/main amd64 c-n-f Metadata [3,332 B]                                
获取:16 http://security.ubuntu.com/ubuntu resolute-security/restricted i386 Packages [13.0 kB]                                 
获取:17 http://security.ubuntu.com/ubuntu resolute-security/restricted amd64 Packages [201 kB]                                 
获取:18 http://security.ubuntu.com/ubuntu resolute-security/restricted Translation-en [35.1 kB]                                
获取:19 http://security.ubuntu.com/ubuntu resolute-security/restricted amd64 c-n-f Metadata [396 B]                            
获取:20 http://security.ubuntu.com/ubuntu resolute-security/universe amd64 Packages [110 kB]                                   
获取:21 http://security.ubuntu.com/ubuntu resolute-security/universe i386 Packages [52.8 kB]                                   
获取:22 http://security.ubuntu.com/ubuntu resolute-security/universe Translation-en [34.6 kB]                                  
获取:23 http://archive.ubuntu.com/ubuntu resolute/main amd64 c-n-f Metadata [32.4 kB]                                          
获取:24 http://security.ubuntu.com/ubuntu resolute-security/universe amd64 Components [42.9 kB]                                
获取:25 http://security.ubuntu.com/ubuntu resolute-security/universe Icons (48x48) [14.6 kB]                                   
获取:26 http://security.ubuntu.com/ubuntu resolute-security/universe Icons (64x64) [23.3 kB]                                   
获取:27 http://security.ubuntu.com/ubuntu resolute-security/universe amd64 c-n-f Metadata [2,996 B]                            
获取:28 http://archive.ubuntu.com/ubuntu resolute/universe amd64 Packages [16.0 MB]                                            
获取:29 http://archive.ubuntu.com/ubuntu resolute/universe i386 Packages [8,511 kB]                                            
获取:30 http://archive.ubuntu.com/ubuntu resolute/universe Translation-en [6,329 kB]                                           
相关推荐
BioTender2 分钟前
Xaira 发布 X-Automate:将物理 AI 与智能体 AI 引入实验室自动化
运维·人工智能·自动化
Percep_gan29 分钟前
Linux中安装gitea,很详细
linux·elasticsearch·gitea
Z21-X1 小时前
云原生运维学习笔记:容器技术的演进、底层原理与 Docker 全生命周期管理
运维·笔记·学习·云原生
Rabitebla9 小时前
【Linux 底层原理】进程(十):进程等待详解---从僵尸进程到 wait、waitpid 与 status
linux·c++·笔记·学习·visual studio
Decay__10 小时前
18_MySQL 智能巡检方案 —— 巡检项清单 / 一键巡检脚本 / 健康评分
运维·数据库·sql·mysql·架构
天远API14 小时前
零信任架构实战:基于天远运营商三要素详版V即时版构建自动化消费电子大促电商平台高价值权益秒杀与优惠券防羊毛高并发实名核验网关
运维·人工智能·架构·自动化
Android系统攻城狮14 小时前
Linux FFmpeg深度解析之avcodec_default_get_encode_buffer调用流程与实战(二十八)
linux·运维·服务器·ffmpeg·车载音视频·ffmpeg音视频
程序员初一14 小时前
8080 打不开的四层定位:监听地址、ufw、DOCKER 链、安全组
linux·ssh
程序开发阿元14 小时前
swappiness 60 和 10 差在哪:一台 1C1G 的三轮对比
linux·ssh
无足鸟ICT15 小时前
【RHCA+】mpstat命令(监控CPU)
linux