27
22

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Ubuntu アップデート時、リポジトリアクセスで 404 が大量に出て更新できない場合の解消方法

Last updated at Posted at 2016-01-13

環境

ubuntu 14.10 です

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.10
DISTRIB_CODENAME=utopic
DISTRIB_DESCRIPTION="Ubuntu 14.10"

現象

Ubuntu 14.10 で、sudo apt-get install docker.io したら

Install these packages without verification? [y/N] y
Err http://archive.ubuntu.com/ubuntu/ utopic/universe docker.io amd64 1.2.0~dfsg1-1ubuntu1
  404  Not Found [IP: 91.189.91.15 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/universe/d/docker.io/docker.io_1.2.0~dfsg1-1ubuntu1_amd64.deb  404  Not Found [IP: 91.189.91.15 80]

こんな感じのエラーが出て入らない。

sudo apt-get update した所、

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/utopic-security/main/binary-i386/Packages  404  Not Found [IP: 91.189.92.201 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/utopic/universe/source/Sources  404  Not Found [IP: 91.189.88.153 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/utopic-security/universe/binary-i386/Packages  404  Not Found [IP: 91.189.92.201 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/utopic/main/binary-amd64/Packages  404  Not Found [IP: 91.189.88.153 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/utopic/universe/binary-amd64/Packages  404  Not Found [IP: 91.189.88.153 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/utopic/main/binary-i386/Packages  404  Not Found [IP: 91.189.88.153 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/utopic/universe/binary-i386/Packages  404  Not Found [IP: 91.189.88.153 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/utopic-updates/main/source/Sources  404  Not Found [IP: 91.189.88.153 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/utopic-updates/universe/source/Sources  404  Not Found [IP: 91.189.88.153 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/utopic-updates/main/binary-amd64/Packages  404  Not Found [IP: 91.189.88.153 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/utopic-updates/universe/binary-amd64/Packages  404  Not Found [IP: 91.189.88.153 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/utopic-updates/main/binary-i386/Packages  404  Not Found [IP: 91.189.88.153 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/utopic-updates/universe/binary-i386/Packages  404  Not Found [IP: 91.189.88.153 80]

E: Some index files failed to download. They have been ignored, or old ones used instead.

このようなエラーになり、updateもできない。

理由

古いUbuntu のパッケージリポジトリは、 archive.ubuntu.com ではなく old-releases.ubuntu.com に移動されています。

解消方法

こちらを参考に。

$ sudo sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

追記:
jp.archive.ubuntu.com 等、jp サブドメインのリポジトリを使っている場合、上記コマンドだと jp.old-release.ubuntu.com に置換されてしまい、 404 になります。
こうなった場合、 sources.list のURLの jp. を削除すれば良いです。
追記ここまで。

この後、

$ sudo apt-get update
$ sudo apt-get install docker.io

入りました!

が、docker は古すぎて使い物になりませんでした。 (1.2)

27
22
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
27
22

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?