Linux

Ubuntu Server 21.04 apt 更新時出現更新錯誤

  • August 14, 2022

我試圖安裝一個由於依賴項而拒絕執行的 deb 包,在嘗試安裝依賴項或作業系統更新失敗後,我解除安裝了 deb 包。由於有許多待處理的更新,我嘗試執行這些更新,但源 URL 報告未找到。

伺服器:ubuntu 21.04

apt update
Hit:1 https://deb.nodesource.com/node_14.x hirsute InRelease
Hit:2 https://dl.yarnpkg.com/debian stable InRelease                       
Ign:3 http://us.archive.ubuntu.com/ubuntu hirsute InRelease                
Ign:4 http://us.archive.ubuntu.com/ubuntu hirsute-updates InRelease
Ign:5 http://us.archive.ubuntu.com/ubuntu hirsute-backports InRelease
Ign:6 http://us.archive.ubuntu.com/ubuntu hirsute-security InRelease
Err:7 http://us.archive.ubuntu.com/ubuntu hirsute Release
 404  Not Found [IP: 91.189.91.38 80]
Err:8 http://us.archive.ubuntu.com/ubuntu hirsute-updates Release
 404  Not Found [IP: 91.189.91.38 80]
Err:9 http://us.archive.ubuntu.com/ubuntu hirsute-backports Release
 404  Not Found [IP: 91.189.91.38 80]
Err:10 http://us.archive.ubuntu.com/ubuntu hirsute-security Release
 404  Not Found [IP: 91.189.91.38 80]
Reading package lists... Done
E: The repository 'http://us.archive.ubuntu.com/ubuntu hirsute 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://us.archive.ubuntu.com/ubuntu hirsute-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://us.archive.ubuntu.com/ubuntu hirsute-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://us.archive.ubuntu.com/ubuntu hirsute-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 configuration details.

關於如何解決這個問題的任何想法

Ubuntu 21.04 是非 LTS 版本,並在 2022 年開始支持。最好的解決方案是升級到目前的 LTS 版本 - 22.04。如果不可能 - 將 /etc/apt/sources.list 中的源更改為https://old-releases.ubuntu.com/ubuntu/ - 這是過時 ubuntu 版本的存檔。

Ubuntu 21.04 (Hirsute Hippo) 的生命週期已於 2022 年 1 月 20 日結束。

引用自:https://serverfault.com/questions/1108176