Katello Client yum.repos.d best practice

Just curious, is it best practice for a new client to remove my old .repos in /etc/yum.repos.d/ folder before I perform a subcription-manager refresh to sync to Katello?


IMO yes, it is better to remove existing .repo files. This lets Katello manage all of the system’s repos.

There’s nothing “bad” about having other .repo files in the directory, but it’s best to only use this when you need to pull down a package for testing/debugging purposes. If Katello isn’t aware of the repo, it can’t include it in errata calculations and the repo will not show in the web UI.

Note that some .repo files are installed via rpm, so you’d need to remove them via rpm erase and not just deleting the .repo file. You can use rpm -qf <file> to check if it’s owned by an rpm. If all of the repo definitions have enabled = 0, they are not affecting anything. You can use yum repolist -v to see which repos the system thinks it’s using.

Also, it’s good practice for the Katello server to not be registered to itself, so you’d want to leave that system’s repo files as-is :slight_smile:

This won’t work with centos-release because it provides more than just the repo files:

# rpm -ql centos-release

That’s why changing the file is actually better: it won’t break on yum update (because yum can’t track intentionally removed files like apt can).

1 Like