YUM (Yellowdog Updater Modified) serves as a vital command-line package management tool utilized in Red Hat-based distributions such as RHEL, Fedora, and CentOS. It simplifies package management within Linux/Unix systems, streamlining processes for easy installation, updates, and uninstallation. The task of verifying package installations holds great significance in package management. The YUM package manager seamlessly accomplishes this task. In this article, I will guide you through how to check if an app package is installed using the yum command in Red Hat-based distributions.
Following is a flow chart to check if an rpm package is installed using yum:
[Distro Used Throughout the Tutorial: RHEL 9.2]
2 Methods to Check if a Package is Installed Using YUM
After you install an app package, you need to ensure that the app is installed properly. Using the yum package manager and its different options is a hassle-free process. In this article, I will guide you through the step-by-step process of checking an installed app using yum.
If you want to know how to install app packages using yum check this detailed article on “How to Install RPM Packages Using YUM”. To list all installed app packages using yum check this simple article “How to Show List of Installed Packages Using YUM”.
Method 1: Check an App Package Using the LIST Option
You can use the list option of the yum command to check if an app package is installed. The list option is very useful for checking all available and installed app packages in your system using the Command Line Interface (CLI). You can check an installed app directly or you can check it from all installed app packages list.
Case 1: Check for an App Package Directly
If you want to directly check if an app package is installed in your Red Hat-based system using the yum list command, then follow this simple step:
-
First open your terminal and run the following command to check for an installed app package:
yum list installed audacity
EXPLANATION- yum: Package manager in Red Hat-based distributions.
- list: This option can show all available and installed packages in your system.
- installed: Tells the list option to show the installed packages.
- audacity: Name of the package I am checking if installed properly.
If the app package you are checking is installed, the results similar to the image above will appear on your terminal.
Case 2: Check for an App Package From All Installed Packages List
You can also check if an app package is installed properly from the list of all installed app packages. In order to do that execute these straightforward tasks:
-
To begin with type the following command in your terminal:
yum list installed | grep audacity
-
Now, hit ENTER. If the package is installed properly in your system your terminal will look like the following image:
Method 2: Check an App Package Using the INFO Option
In Red Hat-based distribution the info option of the yum package manager is very useful. You can use this command to check details about installed app packages in your Linux system. Moreover, it is possible to examine details of packages not yet installed but available for installation from remote repositories. To verify the installation of a particular package, follow these simple steps:
First of all open your terminal and run the following command to check if an app package is installed in your system:
yum info audacity
- info: display more detailed info about your app package.
Now, if that specific app is installed in your system, the detailed info section will indicate it as “Installed Packages“.
sudo yum install yum-utils
sudo yum repoquery -a --installed
Comparative Analysis of Methods
Now, take a look at the following comparison table that illustrates the two discussed methods of using the yum command to check the installation status of an app package in Red Hat-based Linux distributions:
Methods | Cases | Pros | Cons |
---|---|---|---|
Method 1 | Case 1 | Direct and precise result. | Need exact package name. |
Case 2 | Do not need the exact package name. | Can show a false positive response with a similar app package name. | |
Method 2 | Case 1 | Show comprehensive information about package details. | Additional details may be overwhelming for a simple binary check. |
Out of all these commands, Case 1 of Method 1 is the most efficient way to check whether a package is installed or not. If you don’t remember the exact name of the app package then use method 1’s case-2. If you also want to check package details then go for method 2.
What Happens if the Package is Not Installed
If the specific app package is not installed in your system, the terminal output will differ from the image demonstrated in the methods above. You will get different responses in those cases. If you are using the yum list command to check for the installed app package then you will see the response shown in the following image:
But, when you use the yum info command to check the package’s installation status, the response will resemble the following image:
Conclusion
In this article, I have discussed how using different options of the yum package manager you can easily check if a specific app package is installed in your Red Hat-based system. I hope this article will be helpful for you to maintain an up-to-date Linux system.
People Also Ask
How to install a package with yum?
To install a package with yum in any Red Hat-based Linux distributions execute this command sudo yum install Package_name
. then provide the sudo user password and press Y to confirm the installation.
How to check available packages in Linux using yum?
To check all available packages for you to install run the following command yum list available
in the terminal. It will show a list of all available packages that you can install from remote repositories directly.
Where are Linux packages installed?
To check the location of an installed app package in any Linux/Unix-based operating system, use which package_name
or whereis package_name
command. Which command will display the path of the first occurrence of the command found in the PATH variable. Whereis command will display the path of the binary, source, and manual page files of the app package.
Related Articles
- How to Install Specific Version of a Package Using YUM
- How to Install Local Package Using YUM [2 Practical Cases]
- How to List Installed Packages Using RPM [2 Practical Cases]
- 3 Ways to Install Pacman Package Manager in Ubuntu
- How to Install Local Package Using RPM [A Quick Guide]
- How to Install RPM Packages Using DNF [4 Useful Cases]
- How to Install Local Package Using DNF [2 Practical Cases]
- 2 Ways to Install Group Packages Using DNF [With Cases]
- 5 Ways to List Installed Packages in RHEL Using DNF With Cases
- How to Install RPM Packages From Text File [5 Simple Cases]
<< Go Back to Package Installation in Linux | Package Management in Linux | Learn Linux Basics
FUNDAMENTALS A Complete Guide for Beginners