Yum update to specific release from a local repository

Latest response

Hello,

We maintain local RHEL repositories because there is no Internet access in the data center. The repositories were created (from a machine with Internet access) using commands similar to these:

reposync --downloadcomps --download-metadata --arch=x86_64 --repoid=rhel-7-server-rpms --delete --download_path=/var/repos/7/
createrepo -s sha256 --checkts --update --workers=2 -g  /var/repos/7/rhel-7-server-rpms/comps.xml /var/repos/7/rhel-7-server-rpms

Did not pass newest-only to reposync because I want to use the repository for servers running RHEL 7.3 and 7.4.
(Created EUS repositories as well.)

Servers have to be running specific releases for application compatibility.

yum --releasever=7.3 and distroverpkg=redhat-release in /etc/yum.conf do not appear to work without subscribtion-manager.

Is there a way to "yum update" 7.3 and 7.4 servers from the above repositories without ending up with 7.5?

If versionlock is the only option, is there an easy way to generate a versionlock list for 7.3 and 7.4?

Thank you

Responses

Hi David,

You could lock a specific release for updates using the command (this would set minor release version to RHEL7.3 ):

# subscription-manager release --set=7.3

After setting this, you may clean up cache files and run repolist to rebuild repository.

#yum clean all
#yum repolist

I hope this helps.

All the best!

Hi Sadashiva,

Thank you for taking time to reply.

The servers don't have Internet access, so they are not registered through subscription-manager. Here's output from release --set:

# subscription-manager release --set=7.4
This system is not yet registered. Try 'subscription-manager register --help' for more information.
# subscription-manager release --show
This system is not yet registered. Try 'subscription-manager register --help' for more information.
# 

I tried to set it manually in /etc/yum/vars/releasever, but yum update still fetches 7.5 packages.

# cat /etc/yum/vars/releasever 
7.4
# yum check-update kernel redhat-release-server   
Loaded plugins: product-id, search-disabled-repos, subscription-manager, versionlock
This system is not registered with an entitlement server. You can use subscription-manager to register.

kernel.x86_64                                   3.10.0-862.11.6.el7                     rhel-7-server-rpms
redhat-release-server.x86_64                    7.5-8.el7                               rhel-7-server-rpms
# 

Thank you

Hi David,

It seems that plugins are still loaded and active, you could disable it by adding "plugins=0" to /etc/yum.conf file.

Later add "distroverpkg=redhat-release" to your /etc/yum.conf and set 'plugins=0' and then try cleaning cache files, after that check for yum update.

I also understand that from the system where you are trying to run 'yum check-update' is either 7.3/7.4 release, and you've populated all release repos offline earlier till up to 7.5. If so, then the above method should have worked, however, I've not yet tested such methods of offline mode. Need to try...

Could you also paste the output of 'yum repolist', 'ls /etc/yum.repos.d/' for further understanding?

All the best!

Hi David,

If these systems are always offline, it should not be a problem to which ever release version yum is set.
When you manually apply matching updates you've downloaded before, it is more or less unimportant.
And as you say that the systems are not even registered, the repositories can't be accessed anyway. :)

Regards,
Christian

Hi David,

When you don't register the systems, using subscription-manager cannot work - of course - and using yum for online updates
also can not work when you don't have internet access. The only thing left to do for what you want to achieve, is to download
selected updates (continuously) by using an online system and then install these updates manually on your offline systems. :)

Regards,
Christian

Hello Sadashiva and Christian.

Thank you for your help on this issue.

David

You're welcome, David ! We're glad that you appreciate our assistance. :)

Regards,
Christian

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.