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
- You need a system that supports yum like RHEL, CentOS, or RHEL.
- To run the command, you must have administrative privilege (root Privilege).
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:
- Repository Scanning.
- Generating an Update List.
- User Decision.
- 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
- 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.
- 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. After the process is finished, you will get a list of the packages with the latest upgraded 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
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*
- -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. 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*
- -x=firefox* -x=dbus*: This -x option tells Yum to exclude the packages named firefox and dbus from the update process.
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
- –security: This is an option that filters out the update packages including only 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
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 a Specific Package in RHEL Using YUM? [2 Cases]
<< Go Back to Update Packages in Linux | Package Management in Linux | Learn Linux Basics
FUNDAMENTALS A Complete Guide for Beginners