26
14

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.

alpine linuxのapk updateが失敗して動かなくなったときの解決法

Posted at

apk updateできない.

突然,alpine linuxのapk updateが失敗しはじめました. (2019/08/22現在)

$ sudo docker run --rm -it alpine:3.10
[sudo] password for kotauchisunsun: 
Unable to find image 'alpine:3.10' locally
3.10: Pulling from library/alpine
Digest: sha256:72c42ed48c3a2db31b7dafe17d275b634664a708d901ec9fd57b1529280f01fb
Status: Downloaded newer image for alpine:3.10
/ # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.10/main: temporary error (try again later)
WARNING: Ignoring APKINDEX.00740ba1.tar.gz: No such file or directory
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.10/community: temporary error (try again later)
WARNING: Ignoring APKINDEX.d8b2a6f4.tar.gz: No such file or directory
2 errors; 14 distinct packages available

どうやら,

あたりが死んでいるために,動かないようです.
が,ブラウザで開くと普通にダウンロードできます.

解決法

一応フォーラムにもIssueが上がっていますが,最新版でも動かなかったです.

apk WARNING Ignoring APKINDEX No such file or directory #207

単純にalpine linuxをビルドしたいだけ.動かしたいだけなら以下のオプションで動きます.

$ sudo docker run --rm -it --network=host alpine
/ # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
v3.10.2-7-g312cad7bde [http://dl-cdn.alpinelinux.org/alpine/v3.10/main]
v3.10.2-7-g312cad7bde [http://dl-cdn.alpinelinux.org/alpine/v3.10/community]
OK: 10336 distinct packages available

肝は,--network=hostの部分で,これで動くようになります.
どうやらalpine linuxのDNS周りの動きが死んでるっぽく,Issueにもdockerの設定を変更することで回避する方法が書かれていました.

困っている人がいればご参考にください.
しかし,意外に,みんなTwitterとかでつぶやかないのね・・・

26
14
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
26
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?