AI摘要:本文介绍了在Debian 11中执行apt update时出现404错误的解决方法。问题的原因是从2023年4月23日起,Debian的源包地址更换至新地址。解决方法是通过编辑/etc/apt/sources.list文件,将原来的地址替换为新地址,并执行apt update命令。

Powered by AI.

起因

debian 11 执行更新时提示404

问题出现的原因

从2023年4月23日起,debian的源包地址更换至新地址。

解决办法

执行

nano  /etc/apt/sources.list

用一下内容替换

deb http://archive.debian.org/debian/ stretch main contrib non-free
deb-src http://archive.debian.org/debian/ stretch main contrib non-free
deb http://archive.debian.org/debian-security/ stretch/updates main contrib non-free
deb-src http://archive.debian.org/debian-security/ stretch/updates main contrib non-free
deb http://archive.debian.org/debian/ stretch-backports main contrib non-free

然后执行

apt update

更换国内清华源

deb https://mirrors.tuna.tsinghua.edu.cn/debian-multimedia/ bullseye main non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-multimedia/ bullseye main non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-multimedia/ bullseye-backports main
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-multimedia/ bullseye-backports main

更改完 sources.list 文件后请导入 deb-multimedia-keyring ,然后更新索引以生效。

wget https://mirrors.tuna.tsinghua.edu.cn/debian-multimedia/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2016.8.1_all.deb
dpkg -i deb-multimedia-keyring_2016.8.1_all.deb
apt-get update
[AD]【腾讯云】年度爆款2核2G4M云服务器118元/年,新老用户同享
最后修改:2023 年 12 月 29 日
如果觉得我的文章对你有用,请随意赞赏