Keeping subscription-manager current for Oracle Linux katello clients

Hi all! So, I have a handful of Oracle Linux clients getting their patches/etc from my katello server.

As many of you know, Oracle Linux does NOT come with RedHat’s subsscription-manager. The typical solution to this is to manually install subscription-manager from a similar distribution (I use Rocky Linux 9).

Manually adding the necessary RPM’s to an oracle host seems to work quite well.
(for those of you who are curious, the necessary RPM’s are:

libdnf-plugin-subscription-manager
python3-cloud-what
python3-subscription-manager-rhsm
subscription-manager
subscription-manager-rhsm-certificates-20220623

So, what I am now attempting to do is to keep this little bundle of packages CURRENT on my oracle clients. But I am having a very weird rpm-conflict issue.

I have done this: On a daily basis, I sync all of the Rocky Linux versions of the above files to a directory, I run a “createrepo” against the directory, and make it available. The oracle clients have a simple repo file ((located in /etc//yum.repos.d)) that points to it.

So here’s my really weird problem. It seems that lately, I cannot update these on any of the oracle clients. I get the following error:

Error:
 Problem: problem with installed package subscription-manager-1.29.45-1.el9.rocky.0.1.x86_64
  - cannot install the best update candidate for package subscription-manager-1.29.45-1.el9.rocky.0.1.x86_64
  - nothing provides python3-subscription-manager-rhsm = 1.29.45.1 needed by subscription-manager-1.29.45.1-1.el9_6.rocky.0.1.x86_64 from subscription-manager
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

And here’s the rub. Here is the directory contents:

libdnf-plugin-subscription-manager-1.29.30.1-1.el9_1.x86_64.rpm
libdnf-plugin-subscription-manager-1.29.30-1.el9.0.1.x86_64.rpm
libdnf-plugin-subscription-manager-1.29.33.1-1.el9_2.x86_64.rpm
libdnf-plugin-subscription-manager-1.29.33.1-2.el9_2.rocky.0.1.x86_64.rpm
libdnf-plugin-subscription-manager-1.29.38-1.el9_3.rocky.0.1.x86_64.rpm
libdnf-plugin-subscription-manager-1.29.40-1.el9.rocky.0.1.x86_64.rpm
libdnf-plugin-subscription-manager-1.29.42-1.el9.rocky.0.1.x86_64.rpm
libdnf-plugin-subscription-manager-1.29.45.1-1.el9_6.rocky.0.1.x86_64.rpm
libdnf-plugin-subscription-manager-1.29.45-1.el9.rocky.0.1.x86_64.rpm
python3-cloud-what-1.29.30.1-1.el9_1.x86_64.rpm
python3-cloud-what-1.29.30-1.el9.0.1.x86_64.rpm
python3-cloud-what-1.29.33.1-1.el9_2.x86_64.rpm
python3-cloud-what-1.29.33.1-2.el9_2.rocky.0.1.x86_64.rpm
python3-cloud-what-1.29.38-1.el9_3.rocky.0.1.x86_64.rpm
python3-cloud-what-1.29.40-1.el9.rocky.0.1.x86_64.rpm
python3-cloud-what-1.29.42-1.el9.rocky.0.1.x86_64.rpm
python3-cloud-what-1.29.45.1-1.el9_6.rocky.0.1.x86_64.rpm
python3-cloud-what-1.29.45-1.el9.rocky.0.1.x86_64.rpm
python3-subscription-manager-rhsm-1.29.30.1-1.el9_1.x86_64.rpm
python3-subscription-manager-rhsm-1.29.30-1.el9.0.1.x86_64.rpm
python3-subscription-manager-rhsm-1.29.30-1.el9.x86_64.rpm
python3-subscription-manager-rhsm-1.29.33.1-1.el9_2.x86_64.rpm
python3-subscription-manager-rhsm-1.29.33.1-2.el9_2.rocky.0.1.x86_64.rpm
python3-subscription-manager-rhsm-1.29.38-1.el9_3.rocky.0.1.x86_64.rpm
python3-subscription-manager-rhsm-1.29.40-1.el9.rocky.0.1.x86_64.rpm
python3-subscription-manager-rhsm-1.29.42-1.el9.rocky.0.1.x86_64.rpm
python3-subscription-manager-rhsm-1.29.45.1-1.el9_6.rocky.0.1.x86_64.rpm
python3-subscription-manager-rhsm-1.29.45-1.el9.rocky.0.1.x86_64.rpm
repodata
subscription-manager-1.29.30.1-1.el9_1.x86_64.rpm
subscription-manager-1.29.30-1.el9.0.1.x86_64.rpm
subscription-manager-1.29.33.1-1.el9_2.x86_64.rpm
subscription-manager-1.29.33.1-2.el9_2.rocky.0.1.x86_64.rpm
subscription-manager-1.29.38-1.el9_3.rocky.0.1.x86_64.rpm
subscription-manager-1.29.40-1.el9.rocky.0.1.x86_64.rpm
subscription-manager-1.29.42-1.el9.rocky.0.1.x86_64.rpm
subscription-manager-1.29.45.1-1.el9_6.rocky.0.1.x86_64.rpm
subscription-manager-1.29.45-1.el9.rocky.0.1.x86_64.rpm
subscription-manager-rhsm-certificates-20220623-1.el9.noarch.rpm

All of the versions are there. BUT. Notice the exact file name. RPM is complaining this is not available: python3-subscription-manager-rhsm = 1.29.45.1

But the file name is:
python3-subscription-manager-rhsm-1.29.45-1.el9.rocky.0.1.x86_64.rpm

Note the -1 instead of the .1.

I am running into some weird file-name disconnect happening and it’s not making any sense.

How any any of you keeping the oracle-linux subscription-files CURRENT? I believe what I am doing is correct. But wondering if the stock redhat/rocky repositories have some kind of hidden aliases in there somewhere, and thus my attempt at re-creating a mini-repository fails.

In our OracleLinux9 content view we have RockyLinux9 BaseOs repository and filter that includes these packages from this repository:

subscription-manager*
dnf-plugin-subscription-manager*
python3-subscription-manager-rhsm*
python3-cloud-what*
libdnf-plugin-subscription-manager*

and then there is another filter in this content view, which excludes below packages from all repositories:

rhn-check
rhn-client-tools
rhn-setup
rhn-setup-gnome
rhnlib
rhnsd
yum-rhn-plugin
yum-plugin-ulninfo

I do not know if this is super correct but seems to work.

Hmmm. Just re-using the existing rocky repo like that might be the way to go.

FYI,I had a similar setup for something else, and my experience is that when you have filters, the creation of content views takes FOREVER.

How do you solve the cart-before-the-horse issue? When building your oracle linux clients, I am guessing you first manually START with… just manually-installed copies of those rpms (so you can register to katello etc…)?

We use filters on content views without any or maybe little performance impact.
When registering OracleLinux client we temporarily add the repo which points to RockyLinux Base OS, then we install subscription-manager package, then we remove the temporary repo and continue with registration as with standard client.

Overall actually sounds like an elegant solution without re-creating a NEW repo like I have been doing. Definitely going to try this next week. I use ansible when deploying hosts so doing this (temporarily creating the .repo file etc) is pretty simple.

Hi! I appreciate your help thus far on this. One question as I’m a bit confused.

I can add the rocky9 repository to the Oracle-linux-9 content view no problem. (so now the content view contains: ol9 base, ol9 appstream, epel9, and now rocky9-baseos).

But the filter for the content view just specifies… the rpm names. I don’t see how that limits the content view to just those packages from the ROCKY repository.

Am I missing something?.

Nevermind I think I figured it out

Hi, I think the include type of filter on repository includes the specified rpm’s only. Here is a quotation from manual:

When you add an Include filter, the content view no longer assumes you want to Include Everything and changes to only including exactly what you asked for.
If you only set an include filter to include the package bash then only the package bash would be included.
No other packages will be available.