when I do apk update or apk add ..., gives me error below:

fetch http://dl-4.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-4.alpinelinux.org/alpine/v3.8/main: Bad file descriptor 
WARNING: Ignoring APKINDEX.5372d58d.tar.gz: Bad file descriptor
fetch http://dl-4.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
ERROR: http://dl-4.alpinelinux.org/alpine/v3.8/community: Bad file descriptor
WARNING: Ignoring APKINDEX.66c84cb4.tar.gz: Bad file descriptor
2 errors; 75 distinct packages available

Already changed mirrors but gives same errors.

Earlier in this installation apk worked with no problems. Also I can ping the server and I can download the APKINDEX with wget.


Solved the issue by:

$ rm -rf /var/cache/apk
$ mkdir /var/cache/apk
  • This is a work around but create-delete the cache directory is more like a hack. Anyone know the root cause of this.. – LPince Jun 13 at 8:16
  • That smells of corrupted filesystem or disk issue. I would have downloaded on another computer and compare the sha256sum with the APKINDEX downloaded from your PC. – Francesco Colista 9 hours ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.