1

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.

firebush
  • 131
  • 4
  • 2
    CentOS 8 packages were removed from official mirrors today. Answer to this question could be helpful. https://stackoverflow.com/questions/70926799/centos-through-vm-no-urls-in-mirrorlist – Sergei Jan 31 '22 at 17:53
  • Thank you @Sergei. That's the answer I needed. Unfortunately the issue is so new it didn't show up in my searches. I'm not sure whether this should be marked as a duplicate or not. Seems like this question belongs better in serverfault rather than stackoverflow. I'll leave that to the wisdom of our moderators. – firebush Jan 31 '22 at 17:59

0 Answers0