YUM is a package manager for RPM-based Linux distributions such as Fedora, CentOS and Red Hat Enterprise Linux. It allows users to install, update, remove and search for software packages from various repositories. YUM also resolves dependencies and handles configuration files automatically. YUM stands for Yellowdog Updater Modified and was originally developed for the Yellow Dog Linux distribution that ran on PowerPC machines.
The most common commands for YUM can be found below. In the examples below we will focus on installing the monitoring application btop.
Installing a Package
To install the btop package we will use the following command:
sudo yum install btop
Removing a Package
To remove the btop package we will use the following command:
sudo yum remove btop
Updating All Packages
Keeping packages updated in Linux is important for several reasons.
- First, it ensures that the system has the latest security patches and bug fixes, which can prevent potential attacks or crashes.
- Second, it allows the system to benefit from new features and improvements that the developers have added to the packages.
- Third, it helps to maintain compatibility and stability with other packages and software that depend on them.
Therefore, updating packages regularly is a good practice for Linux users.
To update packages, use the following command:
sudo yum update
*Note: If updates are available, a list will appear. In the example above, none were available.
Listing All Installed Packages
To list all installed packages in the system you can use the first command which will list all of them all the way to the end or the second version of the command with the “| less” option to review each page at a time.
sudo yum list [Full list]
OR
sudo yum list | less [One page at a time]
Searching for a Particular Package
To search for a particular package, the following command can be used. In this example we will search for clamav, the malware scanning tool.
sudo yum search clamav
View Package Information
To view package information, we can use the following command. In this example we will search for clamav to display package information, particularly the “clamav.x86_64” we found from the previous command’s output.
sudo yum info clamav.x86_64