Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
20
Help us understand the problem. What are the problem?

More than 3 years have passed since last update.

posted at

updated at

Organization

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

環境

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)

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
20
Help us understand the problem. What are the problem?