欢迎光临
我们一直在努力

Ubuntu 26.04 换阿里云镜像源

先备份原始源,再替换为阿里云源即可。
Ubuntu 26.04(Resolute Raccoon)默认已经使用 .sources 格式,而不是老的 sources.list。

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

将内容替换为:

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

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


3. 更新缓存

sudo apt update


4. 验证是否生效

apt policy

或者:

grep -E "mirrors.aliyun.com" /etc/apt/sources.list.d/ubuntu.sources


一键脚本(推荐)

直接执行:

sudo bash -c 'cat > /etc/apt/sources.list.d/ubuntu.sources <<EOF
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
EOF'

sudo apt update

赞(0)
未经允许不得转载:171主机测评 » Ubuntu 26.04 换阿里云镜像源
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址