Score:1

The latest centos:8 docker image cannot run yum

ls flag

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.

Sergei avatar
id flag
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
ls flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.