LoginSignup
6
2

More than 3 years have passed since last update.

Docker で apt install -y がエラー "Unable to fetch some archives" で止まる

Posted at

環境

Docker 18.09.7, build 2d0083d
コンテナ ubuntu:18.04

状況

下のような Dockerfile でビルドしたイメージを久々にアップデートしようと思って docker build -t <tag> . を実行しました。

Dockerfile
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND noninteractive
RUN set -x \
  && rm -rf /var/lib/apt/lists/* \
  && apt-get update \
  && apt-get upgrade -y \
  && apt-get install -y apt-utils
RUN set -x \
  && apt-get install -y make

apt-get install -y make のところで、下記のようなエラーで止まってしまいました。

E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/t/tzdata/tzdata_2019a-0ubuntu0.18.04_all.deb  404  Not Found [IP: 91.189.88.162 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libd/libdrm/libdrm-common_2.4.95-1~18.04.1_all.deb  404  Not Found [IP: 91.189.88.162 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libd/libdrm/libdrm2_2.4.95-1~18.04.1_amd64.deb  404  Not Found [IP: 91.189.88.162 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_4.15.0-52.56_amd64.deb  404  Not Found [IP: 91.189.88.162 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libd/libdrm/libdrm-amdgpu1_2.4.95-1~18.04.1_amd64.deb  404  Not Found [IP: 91.189.88.162 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libd/libdrm/libdrm-intel1_2.4.95-1~18.04.1_amd64.deb  404  Not Found [IP: 91.189.88.162 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libd/libdrm/libdrm-nouveau2_2.4.95-1~18.04.1_amd64.deb  404  Not Found [IP: 91.189.88.162 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libd/libdrm/libdrm-radeon1_2.4.95-1~18.04.1_amd64.deb  404  Not Found [IP: 91.189.88.162 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/m/mesa/libglapi-mesa_18.2.8-0ubuntu0~18.04.2_amd64.deb  404  Not Found [IP: 91.189.88.162 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/m/mesa/libgl1-mesa-dri_18.2.8-0ubuntu0~18.04.2_amd64.deb  404  Not Found [IP: 91.189.88.162 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/m/mesa/libglx-mesa0_18.2.8-0ubuntu0~18.04.2_amd64.deb  404  Not Found [IP: 91.189.88.162 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/m/mesa/libgl1-mesa-glx_18.2.8-0ubuntu0~18.04.2_amd64.deb  404  Not Found [IP: 91.189.88.162 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

解決策

このようなエラーは一般的に apt-get update をかけることで解決するようですが、今回はイメージの再ビルドでキャッシュが使われてしまったため、アップデートが行われていなかったようです。コマンドに --no-cache をつけて実行し直すと、先に進みました。

docker build --no-cache -t <tag> .
6
2
0

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
6
2