How to do system update, patching, its rollback in RHEL or Centos ?

In this post, we will look how to perform RHEL or CentOS system update, package update, and how to rollback the changes.

We will cover below scenarios:

1. Package update in RHEL or CentOS
2. System update using : Redhat Subscription Manager (RHSM), Redhat Satellite, and Redhat Network (known as RHN which is obsolete now)

Package Update, downgrade in RHEL or CentOS

a. Updating a single package

# yum update vsftpd

b. Installing a new package.

# yum install vsftpd

c. Downgrading a single package
We can also downgrade a single package using YUM like below.

# yum downgrade httpd-2.2.3-22.el5

d. Removing a Package

# yum remove vsftpd

System Update/Downgrade in RHEL: RHSM, Satellite & RHN


1. RHSM (RHEL 7, RHEL 6.1 & above, and RHEL 5.7 & above)  –> When we have direct access to internet.
2. Redhat Satellite –> When we don’t have direct access to internet.
3. RHN(old solution now) :- Works similar to RHSM.

1. RHSM (Redhat Subscription Manager)

a. Register your system using:

RHEL 7: Applications -> System Tools -> Red Hat Subscription Manager and,
RHEL 6: System -> Administration -> Red Hat Subscription Manager. 
RHEL 5 : Applications -> System Tools -> Software Updater(or using "pup" command).
OR,
By using the "subscription-manager" command(on RHEL6 & RHEL 7). 

b. System update after registering

Using GUI: Applications -> System Tools -> Software Update
OR,  # gpk-update-viewer 

c. Using CLI update the system:

# yum update
Note:- We can also check the update packages using the command # yum check-update

2. Redhat Satellite Server and Capsule Server
a. Satellite server provides remote management, provisioning, and monitoring of multiple RHEL deployments using a centralized GUI.

b. Red Hat Satellite Capsule Server mirrors the content from Red Hat Satellite Server to increase the bandwidth and speed of server upgrade tasks, and to facilitate content distribution across various geographical locations.

c. Dedicated system is required for Satellite server.

d. Prerequisites:-

RHEL 7
4 core 2GHz CPU
root access, RHN subscription, 0022 umask, DNS resolution forward and reverse query, 20GB RAM, 4GB Swap.
RHEL Version of Satellite and Capsule server should be same.

3. RHEL Version update, for example: from 7.1. to 7.2

a. Offline:- Download the DVD.iso and create a local repository from which you can upgrade.
b. To update system using YUM:

# subscription-manager release --set=7.2   (or we can use "subscription-manager release" command to update this package)
# yum update redhat-release-server

c. Update directly using yum update “releaserver” option.

# yum update --releasever=7.2

4. RHEL Version Downgrade

1. Identify the kernel package compatible with desired RHEL release.
2. Check & install the kernel package first.

# yum list kernel-2.6.32-358*
# yum install kernel-2.6.32-358.25.2.el6 

3. After installing reboot the system with old kernel version.

4. Now downgrade the system.

# yum downgrade redhat-release

5. Rollback a Yum update transaction

### Run a task
[root@nglinux ~]# yum install vsftpd

### Get the update transaction id from yum history command
[root@nglinux ~]# yum history
Failed to set locale, defaulting to C
Loaded plugins: auto-update-debuginfo, fastestmirror, refresh-packagekit, security
ID     | Login user               | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
    60 | root               | 2018-07-26 19:38 | Install        |    4   
    59 | root               | 2018-07-12 19:33 | Install        |    1   
    58 | root               | 2018-07-11 20:15 | I, U           |    2   
    57 | root               | 2018-07-10 22:46 | Install        |    3   
    56 | root               | 2018-06-04 11:04 | Install        |    3   

### Run the undo command with transaction id to rollback the changes
[root@nglinux ~]# yum history undo 58

Leave a Reply

Your email address will not be published.