With the latest centos:8 docker.hub image I cannot run yum. All yum commands fail with the error message Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
.
This can be reproduced like so:
$ docker pull centos:8
8: Pulling from library/centos
Digest: sha256:a27fd8080b517143cbbbab9dfb7c8571c40d67d534bbdee55bd6c473f432b177
Status: Image is up to date for centos:8
docker.io/library/centos:8
$ docker run -it --init --cap-add=SYS_PTRACE --network=host centos:8 /bin/bash
[root@docker-desktop /]# yum clean all
Failed to set locale, defaulting to C.UTF-8
0 files removed
[root@docker-desktop /]# yum update
Failed to set locale, defaulting to C.UTF-8
CentOS Linux 8 - AppStream 988 B/s | 38 B 00:00
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
I'm not sure whether this is specific to the docker image or is a broader centos:8 issue. I see similar questions about this from over a year ago which suggest modifying /etc/yum/vars/releasever
or removing /var/cache/dnf
, but that releasever
file doesn't exist in this image and removing that dnf
cache does not help.
Any help to resolve this would be appreciated.