How to Update a Specific Package in RHEL Using YUM? [2 Cases]

LINUX
FUNDAMENTALS
A Complete Guide for Beginners Enroll Course Now

In Red Hat Enterprise Linux (RHEL), to maintain the delegate balance between system-wide updates and targeted precision, performing update operations is crucial. Apart from the standard practice of updating all packages, there are scenarios where you may be required to update specific packages to address compatibility issues and access specific features. In Red Hat-based Linux distros, the powerful package management tool, Yum (Yellowdog Updater, Modified) owns the power to update individual packages. This piece of writing explores the method for updating specific packages on your system.

Requirements to Update Package Using “yum”

The Basic of YUM Update

Before diving into the process of updating specific packages, let’s take a moment to briefly revisit the fundamentals of the yum update command. When you execute the ‘yum update’ command, the package manager searches the repositories on your system and compares the available package versions with the currently installed versions on your system.

After querying the repositories, the command provides a list of updates available for the packages and asks you whether you want to proceed or not. You can use the yum update command to update a single package, multiple packages, and all the packages.

2 Cases of Updating a Specific Package in RHEL

You can update a specific package to it’s latest version or update the package to a specific version using yum. 

Case 01: Update a Specific Package

To update a specific package using “yum”, follow the steps below:

  1. Open the terminal on your RHEL.
  2. Run the following command.
    sudo yum update firefox.x86_64
    EXPLANATION
    • sudo: Provides the privilege to perform administrative commands.
    • yum: 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.
    • x86_64: This portion of the command provides a specific package name ‘firefox’ followed by the architecture specification. X86_64 indicates that the package is built for the 64-bit x86 architecture.
  3. Enter the user password to prove identity.Updates the specific package 'firefox' to it's most updated version. You can see here that ‘firefox’ has an available update version of size 107M which is 102.14.0-2.el9_2 and Yum has found it in the mentioned repository.

  4. Press ‘Y’ to continue the update process.Shows the accomplishment information on the update operation of 'firefox'. Here, I got the updated version of firefox.x86_64 package using the yum update command.

Case 02: Update a Package to a Specific Version in RHEL

Sometimes you may be required to update a package of your system to one of its specific versions to get some features of that version or have a stable environment. To update a specific package t a specific version using “yum”, follow the steps below:

  1. Open the terminal in RHEL.
  2. Run the following command.
    sudo yum list dbus --showduplicates
    EXPLANATION
    • sudo: Provides the privilege to perform the administrative command.
    • yum: Allows interaction with the yum package management system in RHEL.
    • list: Instructs the yum package manager to display the list of available packages with detailed information.
    • dbus: It’s the package name whose available all package versions will be searched for and enlisted.
    • –showduplicates: This option tells the yum package manager to show all the available versions of the specified package including duplicates.
  3. Enter the user password to get the list.Enlists the all the available versions of 'dbus' package. Here, you can notice that the output of the command shows the currently installed version of the package ‘dbus’ and also provides a list of all the available versions of the package.

  4. Now, run the following command to update ‘dbus’ to the specific version.
    sudo yum update dbus-1:1.12.20-7.el9_2.1
    EXPLANATION
    • update: Instructs the yum package manager to check the repositories for newer versions of packages and update them if available updates are found.
    • dbus-1:1.12.20-7.el9_2.1: This part specifies the name of the package which is ‘dbus’ including the version of the specific package to which I want to update.
  5.   Enter the user password as directed.Updates 'dbus' to the specified update version mention in the command. Here, the command shows the information on the specified update version, its size, and the repository. A text also appears asking for confirmation to proceed with the operation.

  6. Press ‘Y’ to continue the update process.Shows that the specific package 'dbus' updated successfully to the specific version noted in the command. Here, you can notice that the package named ‘dbus’ has been successfully updated to the specific version of the command which is ‘1:1.12.20-7.el9_2.1’.

Conclusion

In summary, YUM provides a versatile way to handle package updates, letting you concentrate on particular packages and desired versions. You can ensure a stable and secure Linux system, by using the power of yum to update specific packages to specific versions according to your needs. Hope this article quenched your thirst for knowledge on the process of updating a specific package using YUM elaborately with great significance.

People Also Ask

Why to Update a Specific Package

At times, you might come across situations involving compatibility challenges, the need for distinct features from a specific version, or the necessity to return to a previous version owing to stability considerations. Instead of updating all packages and potentially causing disruptions to your system, updating a specific package to a desired version can offer a more controlled approach.

How do I remove a Package from YUM?

To remove a package from yum, simply run ‘yum remove <package_name>’ in the terminal. Replace the <package_name> with a real package name that you want to remove. You must have root privilege to run the command.

How do I list yum packages installed?

To list the packages that are currently installed on your system using the YUM package manager, run the command ‘yum list installed’. This command will display a list of the packages installed on your system, along with their names, and versions.

Where is the yum cache?

The YUM package manager caches its downloaded package files in the ‘/var/cache/yum’ directory. It helps speed up the process of installing or updating apps.

What’s the difference between the yum update and the yum upgrade command?

The yum update command gets the newest versions of programs for your system’s current version. On the contrary, the yum upgrade command does this too, and can also change your system’s entire version. So, update for program updates and upgrade for distribution upgrades.

Related Articles


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

5/5 - (2 votes)
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