RHEL 8 update installed packages for security

last updated in Categories , , ,

I would like to update installed packages for security on RHEL 8.x (Red Hat Enterprise Linux) server. How can I update my RHEL 8.x system using yum command?

Keeping your system, kernel, and the installed application is an essential sysadmin task. An updated RHEL 8 system means fewer security issues and increased system stability. Red Hat Enterprise Linux 8.x is pretty user-friendly when it comes to applying updates and patches. This page shows how to update RHEL system using the yum command or the GUI tools for desktop installation.

RHEL 8 update installed packages for security

The procedure to install updates on RHLE:

  1. Open the terminal app.
  2. For remote server log in using the ssh command: ssh user@server-name-here.
  3. Show information about update advisories, run: sudo yum updateinfo
  4. Issue the command sudo yum update to refresh package database and install updates.
  5. Reboot the system if kernel was updated by typing sudo reboot command.

Let us see all steps in details.

Find out info about available security-related updates

It is a good idea to find out if there any updates available for the box. Hence, run the following command:
sudo yum updateinfo
Sample outputs:

Last metadata expiration check: 0:17:14 ago on Monday 16 September 2019 07:01:29 PM UTC.
Updates Information Summary: available
     6 Security notice(s)
         6 Important Security notice(s)
    10 Bugfix notice(s)

Want to see a list of the updates on screen? Try the following command along with grep command:
sudo yum check-update
sudo yum check-update | more
sudo yum check-update | grep bash
sudo yum check-update

Check for RHEL 8 software and security updates
Before you apply updates please note down Linux kernel version, run:
uname -mrs
Sample outputs:

Linux 4.18.0-80.7.2.el8_0.x86_64 x86_64

How to install updates via yum command line for RHEL 8

Open up a terminal application or log in using ssh. Run the yum command to upgrade all installed packages on Red Hat Linux system:
$ sudo yum update
RHEL 8 Applying Security Updates Using yum
One can only apply security related updates to the machines, run:
sudo yum --security update
RHEL 8 update installed packages using yum

How do I update a single package?

Run the following command:
sudo yum update pkg_name
sudo yum update bash

It is also possible to install all updates except kernel and bash packages as follows:
sudo yum -x 'kernel*' -x 'bash*' update
The -x option exclude packages specified given name. See “Force yum update Command To Exclude Certain Packages” for more info.

Reboot the Linux system

You must reboot system when RHEL 8.x Linux kernel gets updated, run:
sudo reboot
Verify Linux kernel version and list updates:
uname -mrs
sudo yum updateinfo

Checking For and Updating Packages on RHEL 8
Checking for package updates on RHEL 8

Conclusion

You learned how to install the software update for all installed packages using the GUI and CLI methods on RHEL 8.x based systems. See RHEL yum man page for more information.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Start the discussion at www.nixcraft.com

Historical Comment Archive

1 comment

    Still, have a question? Get help on our forum!