環境
- Google Cloud / Compute Engine / Ubuntu 17.10
サポート切れの古いUbuntuのアップデートをした際に以下のようなエラーで更新ができないことがあります
Ign:1 http://us-east1.gce.archive.ubuntu.com/ubuntu artful InReleaseIgn:2 http://us-east1.gce.archive.ubuntu.com/ubuntu artful-updates InReleaseIgn:3 http://us-east1.gce.archive.ubuntu.com/ubuntu artful-backports InReleaseErr:4 http://us-east1.gce.archive.ubuntu.com/ubuntu artful Release404 Not Found [IP: 35.196.128.168 80]Err:5 http://us-east1.gce.archive.ubuntu.com/ubuntu artful-updates Release404 Not Found [IP: 35.196.128.168 80]Err:6 http://us-east1.gce.archive.ubuntu.com/ubuntu artful-backports Release404 Not Found [IP: 35.196.128.168 80]Ign:7 http://security.ubuntu.com/ubuntu artful-security InReleaseErr:8 http://security.ubuntu.com/ubuntu artful-security Release404 Not Found [IP: 91.189.91.39 80]Get:9 http://packages.cloud.google.com/apt google-cloud-logging-wheezy InRelease [5483 B]Ign:10 http://packages.cloud.google.com/apt google-cloud-monitoring-artful InReleaseErr:11 http://packages.cloud.google.com/apt google-cloud-monitoring-artful Release404 Not Found [IP: 142.250.98.113 80]Hit:12 http://archive.canonical.com/ubuntu artful InReleaseErr:9 http://packages.cloud.google.com/apt google-cloud-logging-wheezy InReleaseThe following signatures couldn't be verified because the public key is not available: NO_PUBKEY B53DC80D13EDEF05 NO_PUBKEY FEEA9169307EA071Reading package lists… DoneE: The repository 'http://us-east1.gce.archive.ubuntu.com/ubuntu artful 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-east1.gce.archive.ubuntu.com/ubuntu artful-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-east1.gce.archive.ubuntu.com/ubuntu artful-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://security.ubuntu.com/ubuntu artful-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.E: The repository 'http://packages.cloud.google.com/apt google-cloud-monitoring-artful Release' does not 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: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://packages.cloud.google.com/apt google-cloud-logging-wheezy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B53DC80D13EDEF05 NO_PUBKEY FEEA9169307EA071
1)キーを更新します。 これでKeyのエラーは解消されます
curl -f https://packages.cloud.google.com/apt/doc/apt-key.gpg \| sudo apt-key add -
2)リポジトリの接続先が古いので修正します
参照先を http://old-releases.ubuntu.com/ に修正します。archiveもsecurityも同様です。Compute EngineのリストはGoogleのミラーを示しているので一旦Ubuntuの方に変更しておくのもよいかと思います。ググるとリストから取り除くみたいな記述もあるのですがそれをするとUpdateできなくなりますので修正しておきます。
deb http://old-releases.ubuntu.com/ubuntu/ artful main restricteddeb http://old-releases.ubuntu.com/ubuntu/ artful-updates main restricteddeb http://old-releases.ubuntu.com/ubuntu/ artful universedeb http://old-releases.ubuntu.com/ubuntu/ artful-updates universedeb http://old-releases.ubuntu.com/ubuntu/ artful multiversedeb http://old-releases.ubuntu.com/ubuntu/ artful-updates multiversedeb http://old-releases.ubuntu.com/ubuntu/ artful-backports main restricted universe multiversedeb http://old-releases.ubuntu.com/ubuntu/ artful-security main restricteddeb http://old-releases.ubuntu.com/ubuntu/ artful-security universedeb http://old-releases.ubuntu.com/ubuntu/ artful-security multiverse
これで無事に apt upgrade 出来るようになったかと思います。