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”
- You need a system that supports yum like RHEL, CentOS, or Fedora.
- To run the command, you must have administrative privilege (root Privilege).
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:
- Open the terminal on your RHEL.
- 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.
-
Enter the user password to prove identity. 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.
- Press ‘Y’ to continue the update process. 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:
- Open the terminal in RHEL.
- 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.
-
Enter the user password to get the list. 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.
- 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.
-
Enter the user password as directed. 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.
-
Press ‘Y’ to continue the update process. 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
- A Complete Overview of sudo apt update Command in Linux
- An Ultimate Guide of “sudo apt-get update” Command in Linux
- [Fixed] sudo apt update Not Working Error in Ubuntu
- [Fixed] sudo apt-get update Not Working in Ubuntu
- [Fixed] APT-Get Update Failed to Fetch Error in Linux
- How to Update RPM Packages in RHEL? [6 Methods]
- How to Check Updates Using YUM on RHEL? [5 Practical Cases]
- How to Update All Packages in RHEL Using YUM? [3 Cases]
<< Go Back to Update Packages in Linux | Package Management in Linux | Learn Linux Basics
FUNDAMENTALS A Complete Guide for Beginners