
在嘗試任何類型的 apt-get 推薦時,我收到以下錯誤清單。例如, sudo apt-get update 最終給了我
Reading package lists... Done
E: The repository 'http://us.archive.ubuntu.com/ubuntu zesty Release' does no longer have 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 zesty-updates Release' does no longer have 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 zesty-backports Release' does no longer have 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.
W: The repository 'http://us.archive.ubuntu.com/ubuntu zesty-security Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
因此,這裡有很多解決方案,其中涉及更換不同的鏡子,但這對我來說失敗了。我切換到主伺服器,沒有任何變化。我要求系統為我選擇最好的伺服器,然後出現一個視窗「未找到合適的下載伺服器,請檢查您的網路連線」。好吧,我可以 ping 谷歌(並問這個問題!),所以看來互聯網不是問題。
有人有什麼想法嗎?
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 17.04
Release: 17.04
Codename: zesty
答案1
首先我們將修復您的儲存庫:
sudo sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
這應該會調整你的/etc/apt/sources.list
看起來類似這樣:
deb http://old-releases.ubuntu.com/ubuntu/ zesty-updates main
deb http://old-releases.ubuntu.com/ubuntu/ zesty-backports main
deb http://old-releases.ubuntu.com/ubuntu zesty-security main
deb http://old-releases.ubuntu.com/ubuntu zesty main universe restricted multiverse
然後運行:
sudo apt-get update && sudo apt-get dist-upgrade