Error cannot find a valid baseurl for repo baseos rocky linux

We need to remove the comment from below Appstream , BaseOS and Extras.repo files

[root@rhel8 ~]# cd /etc/yum.repos.d/
[root@rhel8 yum.repos.d]# ls
Rocky-AppStream.repo Rocky-Devel.repo Rocky-Media.repo Rocky-PowerTools.repo Rocky-Sources.repo
Rocky-BaseOS.repo Rocky-Extras.repo Rocky-NFV.repo Rocky-ResilientStorage.repo
Rocky-Debuginfo.repo Rocky-HighAvailability.repo Rocky-Plus.repo Rocky-RT.repo
[root@rhel8 yum.repos.d]#

Are you referring to removing the comment for this line:


normally will also mean commenting the mirrorlist line as well if you do that. However, sometimes it’s easier just to do:

dnf clean all
dnf update

to clean all dnf content and refresh the mirrors, etc.

Indeed. The default repo config does define mirrorlist. The defined Rocky’s HTTPS-server returns a list of URLs to repo mirrors near you. The baseurl would force your system to use only one URL. That points to by default, which is under heavy load because mirrors are syncing from it too (as 9 is new).

The mirrorlist offers better performance and load balancing. If you must use fixed URL, then pick a mirror near you.

As for editing the config files, the dnf config-manager might be cumbersome, a configuration management system (e.g. Ansible, Chef, Puppet, Salt) would be awesome, but for dirty hack sed is “fun” (unless you end up in tears).

1 Like