Stuck Trying to Migrate from CentOS Linux to Rocky Linux after EOL?

Stuck Trying to Migrate from CentOS Linux to Rocky Linux after EOL?


2 min read

So CentOS Linux is already passed their End of Life and I forgot to migrate my system to Rocky Linux. What could be worse?

I run the migration script today and I encountered this pellicular error:

Error: Error downloading packages:  No URLs in mirrorlist

I thought it was just a random network error, well it also failed with dnf update. Things go dark from here.

After a few hours of trial and error debugging the network. I successfully fixed it by changing the CentOS' YUM repo server to one of the mirror servers. What this is means is that the canonical CentOS YUM repo server list ( is simply no longer be usable anymore and we need to change it to one of the usable mirrors left in the world.

One of the mirrors that worked for me when I wrote this is There are lots of other mirrors to choose from listed here.

To change the CentOS YUM repo server used, you need to modify these files using vim or nano (your list may be more or less, you need to check which yum repos enabled in your machine using yum repolist --enabled :


You need to comment out the mirrorlist and uncomment the baseurl with changing the mirror base URL. The changes are done like this:

name=CentOS Linux $releasever - BaseOS
- mirrorlist=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
+ #mirrorlist=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
- #baseurl=$contentdir/$releasever/BaseOS/$basearch/os/
+ baseurl=$contentdir/$releasever/BaseOS/$basearch/os/

I run the migration system again and things work so well. guess I need to share this small tip so I can save someone else's hours haha. Hope it is useful!