Installing From The Vault
(2022-02-01)
Problem
# sudo dnf (operation)
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
#
Solution
CentOS-8 is end of life. If you want to use the last released version of everything that's "official" CentOS-8, you gotta use the vault.
# sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
# sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*
(Source)