修复ubuntu22.10更新或安装软件失败,报404错误的问题

在一台好久没有升级的ubuntu22.10机器上运行 sudo apt update 命令时,报出了类似以下错误:

sudo apt update

Ign:1 http://archive.ubuntu.com/ubuntu kinetic InRelease
Ign:2 http://archive.ubuntu.com/ubuntu kinetic-updates InRelease
Ign:3 http://archive.ubuntu.com/ubuntu kinetic-backports InRelease
Ign:4 http://archive.ubuntu.com/ubuntu kinetic-security InRelease
Err:5 http://archive.ubuntu.com/ubuntu kinetic Release
  404  Not Found [IP: 185.125.190.36 80]
Err:6 http://archive.ubuntu.com/ubuntu kinetic-updates Release
  404  Not Found [IP: 185.125.190.36 80]
Err:7 http://archive.ubuntu.com/ubuntu kinetic-backports Release
  404  Not Found [IP: 185.125.190.36 80]
Err:8 http://archive.ubuntu.com/ubuntu kinetic-security Release
  404  Not Found [IP: 185.125.190.36 80]
Reading package lists... Done
E: The repository 'http://archive.ubuntu.com/ubuntu kinetic Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://archive.ubuntu.com/ubuntu kinetic-updates Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://archive.ubuntu.com/ubuntu kinetic-backports Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://archive.ubuntu.com/ubuntu kinetic-security Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user confi

用 apt install 命令安装软件也不行,报错类似。

查了一下,Ubuntu 22.10已经不再得到支持了,并且 archive.ubuntu.com 不再为该版本提供包。请按照Ubuntu的升级文档升级到最新版本。

在我的例子中,我在 /etc/apt/sources.list 中将 *.archive.ubuntu.com 源替换为 old-releases.ubuntu.com ,再运行 apt update 就能正常更新了

sudo sed -i 's|http://\([a-z0-9.-]*\)\.archive.ubuntu.com/ubuntu|http://old-releases.ubuntu.com/ubuntu|' /etc/apt/sources.list

在此之后,明智的做法是升级到较新的版本:

do-release-upgrade

 欢迎关注公众号:清晰编程,获取更多精彩内容

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值