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?

Thanks.

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
/etc/centos-release
/etc/centos-release-upstream
/etc/issue
/etc/issue.net
/etc/os-release
/etc/pki/rpm-gpg
/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-7
/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Testing-7
/etc/redhat-release
/etc/rpm/macros.dist
/etc/system-release
/etc/system-release-cpe
/etc/yum.repos.d/CentOS-Base.repo
/etc/yum.repos.d/CentOS-CR.repo
/etc/yum.repos.d/CentOS-Debuginfo.repo
/etc/yum.repos.d/CentOS-Media.repo
/etc/yum.repos.d/CentOS-Sources.repo
/etc/yum.repos.d/CentOS-Vault.repo
/etc/yum.repos.d/CentOS-fasttrack.repo
/etc/yum/vars/infra
/usr/lib/systemd/system-preset/85-display-manager.preset
/usr/lib/systemd/system-preset/90-default.preset
/usr/share/centos-release/EULA
/usr/share/doc/centos-release/Contributors
/usr/share/doc/centos-release/GPL
/usr/share/doc/redhat-release
/usr/share/redhat-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