We have RHEL - Red Hat Enterprise Linux Servers (VMs) in a typical 3 tier landscape ie - Sandbox/Dev, Quality and Prod. During the initial build of the servers back in early 2018, I created the Sandbox/Dev VM from scratch, updated all the packages (yum-update) and then created a template out of this VM. I used the same template for creating the Quality and Prod VMs and just changed hostnames and IP address etc. thus all the VMs were identical.

Recently I upgraded OS from Rhel 7.4 to 7.5 on Sandbox/Dev and then ran (yum update) to update the packages. The system is under testing by end users for the applications that run on it.

I'll be performing OS upgrade on the Quality server after a couple of weeks and on Production Server next month. Now my question is, how do I maintain the same version of packages on Quality & Production server.

Eg: libstdc++-4.8.5-28.el7_5.1.x86_64 is 4.8.5-28 after running the yum-update.How do I get the same version for Quality and Production even if there is a new version -let's say 4.8.6 out there. How do I get this for all the packages installed on my system? I mean I want all the packages in all the 3 servers to be on same version.

Please help and advice.



  • 1
    I would suggest you to make a local yum repository. When you update Sandbox/dev, you put in the local repository all the updated packages that were installed on SandBox/Dev. Then you change the source for yum on Quality and Production to the local repository and update from there. Here are instructions how to make a local repository phoenixnap.com/kb/create-local-yum-repository-centos. Other option I see is to specify every package with version when updating production and quality.
    – nobody
    Oct 29, 2020 at 16:40
  • So, if I understand correctly 1. Create a local repository 2. Get the latest rpm files in this repository from the repositories I have subscribed to 3. Use the same local repository and the files(rpm) on Quality and Prod Server Please correct if wrong. Thanks, Sid
    – SiddJayy
    Oct 29, 2020 at 17:04
  • Red Hat also offers the Satellite product for this task. The product datasheet can be found here: redhat.com/en/resources/satellite-datasheet
    – Haxiel
    Oct 29, 2020 at 17:08
  • @SiddJayy Yes, you understand correctly. It is tedious task to populate your local repository, but I think you should be able to find them in /var/cache/yum.
    – nobody
    Oct 30, 2020 at 7:49
  • In the previous comment I meant, that you can find the update packages that were used to update sandbox/dev in /var/cache/yum/. From there you can copy them to local repository for updating Quality and Production.
    – nobody
    Oct 30, 2020 at 8:00

1 Answer 1


To avoid this situation, after defining your native REPO, you can exclude related packages from the updates in yum updates.

First of all, we go to the REPO directory:

vi /etc/yum.repos.d/

Then we create a new REPO:

vi local.repo in
[Local Repo Name]
name=Local Repo
baseurl=http:// or file://rpm.path

Cache operations

yum clean all #Delete the entire repo cache.
yum makecache #Make the new repo cache

So far, we have made the necessary definitions to update to a version we want. Now when updating the respective packages, Redhat will first look at the definition here. However, if the more up-to-date packages here are available in public REPO, they will continue to be updated. To prevent this, make an arrangement as follows:

vi /etc/yum.conf in
exclude=packagename* #libstdc* etc...

From now on, our packages will remain up to date in the version we want. You can also do this application in kernel updates, and you can prevent stabilazation problems after kernel updates.

  • Hello Menderes,
    – SiddJayy
    Oct 29, 2020 at 17:09
  • Hello Menderes, So, in the step two - "We create new repo" 1. how do I get updated packages from the subscribed repositories? Is this where I give the url of the subscribed repository? What you're suggesting is - From the repositories that I have subscribed to, I pull updates to custom repo that I created and exclude the packages that need to stay same. So when I do the update on QA and PRD servers using the custom repo that I created, it will update the packages not in the exclude list to latest ones but keep ignore the ones from exclude list? Hope I got this correct.
    – SiddJayy
    Oct 29, 2020 at 17:32
  • Hello @SiddJayy, Yes, the system continues to install the latest packages, except for the exclusion list. There are two methods of pulling packages for your subscription. In the first method, you either mount an ISO file containing the package you want to update, enter this mount into the system and baseurl, or use the reposync Redhat offers. For detailed information about reposync: access.redhat.com/solutions/23016
    – menderes
    Oct 29, 2020 at 17:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .