How to Update All Packages in RHEL Using YUM? [3 Cases]

LINUX
FUNDAMENTALS
A Complete Guide for Beginners Enroll Course Now

In the ever-evolving world of Linux systems, package management is a core responsibility in guaranteeing the stability, security, and peak efficiency of the system. Out of different package managers, Yum (Yellowdog Updater, Modified) stands out as a potent utility frequently employed in Linux distribution based on Red Hat, like RHEL, CentOS, and Fedora. One of the crucial characteristics involves the capability to simultaneously update all installed packages, ensuring that your system stays current and fortified against potential vulnerabilities.

Key Takeaways

  • Getting introduced to the Yum package manager.
  • Knowing the functions of the yum update command regarding updating packages in RHEL.
  • Being familiar with three aspects of the command in terms of performing updates.

Requirements

What is YUM?

YUM (Yellowdog Updater, Modified) is a package management utility used in Red Hat-based Linux distributions. It simplifies software installation, updates, and management by resolving dependencies and providing a user-friendly interface to interact with software repositories and packages.

Understanding the “yum update” Command

When you execute the ‘yum update command’, the package manager starts to locate up-to-date versions of the installed packages by scanning the system’s configured repositories. After that, it provides a list of available updates and information about each update, such as the package name, version, size, and a brief description. Yum update command takes the following steps to update all packages:

  1. Repository Scanning.
  2. Generating an Update List.
  3. User Decision.
  4. Updating Packages.

The Necessity of Updating All Packages

  • Security: It’s so common to identify software vulnerabilities in your system over time. Updates of the packages contain patches to fix these vulnerabilities. That’s why you update packages to ensure a protected system against potential security. breaches.
  • Stability: Updates very often include bug fixes that address issues and improve the strength and health of your system.
  • System Performance: Updates may contain performance optimizations that make the software faster and more efficient, which can result in a better user experience.
  • Feature Enhancement: Updates can also add new features and functionalities to enhance your experience with the software.

3 Cases of Updating All Packages Using YUM

It’s pretty convenient and easier for the user to update all the installed packages on RHEL using yum as it provides flexibility and versatility to operate according to the user’s requirements. To elaborate, there are instances where you might want to update all packages, while at other times, you might choose to exclude specific ones from the update process.

In this section, you’ll get an insight into this concept through the examination of three cases of package updates including two interesting examples.

Case 01: Update All Packages Using “yum”

The most basic act of every Linux user is to update all the existing packages of his system to keep a healthy environment. It’s just a single command needed to accomplish the operation stated below.

Steps to Follow >

➊  At first, Open a terminal on your RHEL system.

➋ Now, run the following command to update and enter the user password as directed in the image.

sudo yum update
EXPLANATION
  • sudo: Provides the privilege to perform administrative commands.
  • yum: This is a package manager tool that interacts with the packages to manage the software.
  • update: Tells yum to perform an update operation to get the up-to-date versions of the packages.

Enlists the packages of RHEL using the sudo yum update command.

OUTPUT ANALYSIS
  • Package Name: The first column of the upgrading list holds the package name that avails a new version for update.
  • Arch: The arch field in the output of the yum update command shows the architecture that the package is meant to work with.
  • Version: The third column of the yum update command shows the version of the package that is available for update.
  • Repository: This indicates where the package update is taken It helps you to figure out where the update comes from.
  • Size: The size column tells you how big the package update

➌ Now, Type Y to continue the update process for the enlisted packages. Press 'y' to continue the update process. After the process is finished, you will get a list of the packages with the latest upgraded versions. Shows the list of the updated packages of newer versions.Here, you can see the list and a ‘complete!’ message that assures the accomplishment of the updating operation.

Case 02: Update Packages, Excluding a Few

Sometimes you may require to update your system but you want to keep some of the packages at their current version for your convenience. In simple terms, you want to avoid updating them. In that case, you can use the yum update command here also with an extended option that is –exclude or -x.

To give you a practical overview, I’ll discuss a few examples for your better understanding. To make it more clear, I’ve checked updates for the packages that have available newer update versions using the following command.

sudo yum check-update

Enlists all the packages to update using yum check-update command.Here, you can notice a list of the packages with their newer update version and repository list. Now, I’ll try to give you some examples of avoiding specific packages while updating all below.

Example 01: Update All Packages Excluding a Single Package

To avoid a single package, while updating all packages in your system you can simply run the following command:

sudo yum update -x=firefox*
EXPLANATION
  • -x=firefox*: This option tells yum to exclude the package named firefox from the update process.

After running the command, enter your user password. Immediately you’ll get the list of the packages without Firefox. Now, type Y as you’ve done above to continue the update process.Excludes 'firefox' package while updating all the packages of the system Here, you can see a list of updatable packages but the list doesn’t contain the ‘firefox’ package anymore. You can compare this list with the previous list of all packages.

Example 02: Update All Packages Excluding Multiple Packages

In case of necessity, you can also exclude multiple packages while updating. You can implement the operation using the command yum update with the additional exclude or x option as many packages you want to exclude. You can use the option multiple times to exclude as many packages as you need. In my case, I’ve run the following command:

sudo yum update  -x=firefox* -x=dbus*
EXPLANATION
  • -x=firefox* -x=dbus*: This -x option tells Yum to exclude the packages named firefox and dbus from the update process.

Avoids multiple packages during update process of all the packages.This command will require you a password to authenticate your identity. So, enter the user password to run the operation.

Here, the packages that match the name firefox and dbus, are avoided while updating. You’ll understand it more clearly if you compare the list with the all-packages list for an update. Now, just type Y as directed to continue the update process and you will get an updated system with those packages in their older version.

Case 03: Update Only Security-Related Packages

Whenever you need to update your systems’ security-related packages just run the following command, it will update all the security packages within a while.

sudo yum update --security
EXPLANATION
  • –security: This is an option that filters out the update packages including only the security-related packages.

Only updates the security-related packages.Here, you can see in the package list that only security-related packages are enlisted. You can compare the package list with the first package list of all packages for updates.

Conclusion

The yum update command is crucial for effective Linux system management. It maintains the package current ensuring security, stability, and improved performance. Whether you are experienced or new, mastering YUM update is essential for skilled system management.

People Also Ask

How to install yum?

To install YUM, open your terminal and execute the command ‘sudo dnf install yum’. Once the installation is complete, you can use the power of yum to manage software packages, updates, and dependencies efficiently.

Does the yum update command update the kernel?

Yes, the yum update command can update the Linux kernel.  When you run the command yum update, it checks updates in the repositories for all installed packages including kernel also. If it finds any update available, then will download and install it.

Where is the YUM directory?

YUM configuration and repository filer are typically in /etc/yum.repos.d, yum package cache is in /var/cache/yum, and metadata resides in /var/lib/yum directory.

Does yum install RPM?

Yes, yum install RPM install specified  RPM package and its dependencies from enabled repositories on RPMM-based Linux distributions.

Related Articles


<< Go Back to Update Packages in Linux | Package Management in LinuxLearn Linux Basics

Rate this post
Auhona Islam

Auhona Islam is a dedicated professional with a background in Electronics and Communication Engineering (ECE) from Khulna University of Engineering & Technology. Graduating in 2023, Auhona is currently excelling in her role as a Linux content developer executive at SOFTEKO to provide a more straightforward route for Linux users. She aims to generate compelling materials for Linux users with her knowledge and skills. She holds her enthusiasm in the realm of Machine Learning (ML), Deep Learning (DL), and Artificial Intelligence (AI). Apart from these, she has a passion for playing instruments and singing. Read Full Bio

Leave a Comment