EOL 後に 17.04 から 17.10 にアップデートすると apt-get update が失敗し、ミラーが見つかりません

EOL 後に 17.04 から 17.10 にアップデートすると apt-get update が失敗し、ミラーが見つかりません

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.

ここでは、別のミラーに変更するなどの解決策がいくつかありますが、私の場合はうまくいきませんでした。メイン サーバーに切り替えても、変化はありません。システムに最適なサーバーを選択するように要求すると、「適切なダウンロード サーバーが見つかりませんでした。インターネット接続を確認してください」というウィンドウが表示されます。Google に 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

関連情報