Server Setup

How to fix dnf after CentOS 8 went EOL

by , , revisited on


We have by far the largest RPM repository with NGINX module packages and VMODs for Varnish. If you want to install NGINX, Varnish, and lots of useful performance/security software with smooth yum upgrades for production use, this is the repository for you.
Active subscription is required.

It’s the year 2022 and RedHat has stopped the development of CentOS 8 by removing packages from its primary servers.
Essentially, RedHat first took over CentOS, then deprecated it.

If for whatever reason, you are stuck with the now EOL version of the CentOS operating system, you can no longer run the dnf upgrade successfully. Running dnf upgrade in CentOS 8 will yield the following results:

CentOS Linux 8 – AppStream 514 B/s | 38 B 00:00
Error: Failed to download metadata for repo ‘appstream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist

Exited with code exit status 1

The following commands point to the Cloudflare-based vault repository, which makes dnf work again.

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.epel.cloud|g' /etc/yum.repos.d/CentOS-Linux-*

The vault.epel.cloud is more reliable than vault.centos.org, which has severe downtime issues.

The right thing to do now is to upgrade to Rocky Linux 8. If you don’t have any bad packages installed, upgrading is pretty easy:

dnf -y upgrade
curl https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh -o migrate2rocky.sh
chmod u+x migrate2rocky.sh
./migrate2rocky.sh -r
reboot

Verify that you are running Rocky Linux 8 using cat /etc/redhat-release.

Want to say thanks?

  1. lol

    Like!

    Reply

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: