【Ubuntu】Ubuntu 24 设置镜像源

[复制链接]
发表于 2026-10-6 21:57:24 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×

背景

虚拟机里新装的 Ubuntu 24.04 默认使用国外软件源,下载很慢,需要换成国内镜像源(以阿里云为例)。

写入阿里云镜像源

旧式 /etc/apt/sources.list 写法(noble 对应 24.04):

deb https://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse

Ubuntu 24.04 也支持 deb822 格式,写入 /etc/apt/sources.list.d/ubuntu.sources:

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

更新缓存

sudo apt-get update
sudo apt-get upgrade

qidao123.com企服评测-应用市场 编辑提示:清华、中科大、163 等也提供 Ubuntu 镜像源,写法相同;更换前建议先备份原 sources 文件,便于回退。

回复

使用道具 举报

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表