How to Check a Particular Package is Installed on Linux

In Linux, software package management plays a crucial role in the seamless operation of a system that involves the installation, upgrading, configuration, and removal of software packages.

A package manager is a software tool that automates the management of software on a system by simplifying complex tasks such as installation, upgrading, and removal of software packages.

In this article, we will explore the importance of package management and provide a comprehensive guide on how to check whether a package is installed using a package manager in Linux systems.

1. Using APT and DPKG (Debian)

On Debian-based systems such as Ubuntu and Linux Mint, the APT (Advanced Packaging Tool) and dpkg (Debian Package Manager) are essential tools for managing software packages.

To check if a package is installed with APT or dpkg, you can use any of the following commands.

apt list --installed | grep <package-name>
OR
dpkg -l | grep <package-name>

The command lists installed packages using apt or dpkg, and the grep command filters the output to show information about a specific package.

Find Specific Package Installation
Find Specific Package Installation

Replace <package-name> with the name of the package you want to check. If the package is installed, you will see relevant information; otherwise, there will be no output.

2. Using YUM and DNF (RHEL)

On Red Hat-based systems such as CentOS, Fedora, and Rocky and AlmaLinux, the YUM (Yellowdog Updater, Modified) and DNF (Dandified YUM) are the most commonly used package managers.

To check if a package is installed with yum or dnf, you can use any of the following commands.

yum list installed | grep <package-name>
OR
dnf list installed | grep <package-name>
Check Specific Package Installation
Check Specific Package Installation

Alternatively, you can use the rpm command to check for the presence of a package.

rpm -qa | grep <package-name>

3. Using Pacman (Arch Linux)

On Arch Linux-based systems, such as Manjaro and Garuda, the Pacman is the default package manager and to check if a specific package is installed or not, use the following command.

pacman -Q | grep <package-name>

4. Using Zypper (SUSE Linux)

The package manager used on SUSE Linux distributions, including openSUSE, is called Zypper and to check whether a package is installed using Zypper, you can use it.

zypper search --installed-only <package-name>
Conclusion

Checking whether a package is installed through a package manager is a task that varies depending on the system and package manager you are using. The commands provided in this guide are general commands that can be used for specific needs.

Regularly verifying the status of installed packages is a good practice for system administrators and developers alike. It ensures that the required dependencies are present and helps to maintain a secure and well-functioning system.

Two small things before you go

If something didn’t work on your setup, leave a comment and tell me which distro and version you’re on. I read every one, and most of these articles got better because a reader pointed out what was missing.

And if it did work, share it. TecMint has stayed free for 14 years because people pass these articles around, and that traffic is what pays for writing the next one.

Leave a comment
Get two free Linux courses

Learn the Linux basics with two free courses and join 34,000+ readers getting practical TecMint tutorials and selected Pro TecMint articles every week.

Pro TecMint
Get lifetime access for $99

If you want to go beyond the free tutorials, Pro gives you 18 courses, 5 ebooks, and every future course I add. One payment, lifetime access, no renewals.

Ravi Saive
Ravi Saive
Administrator
About the author

I'm Ravi Saive, an award-winning entrepreneur and founder of several successful 5-figure online businesses, including TecMint.com, GeeksMint.com, UbuntuMint.com, and the premium learning hub Pro.Tecmint.com.

2 Comments

Leave a Reply
  1. I use a Debian-based distro so I just use the “Installed” option with Synaptic.

    This is the 21st century. There is no need for magic spells and incantations of CLI anymore. Yes, CLI is useful IF you are a hobbyist or a developer or an experimenter. An everyday Linux user can use it without ever resorting to the command line.

    Imagine where Windows would be today if all the “pundits” and “experts” insisted that CLI is the way to productive computing.

    If it wasn’t for pundits and “experts” extolling the virtues of and need for CLI, Linux would be much more than just a blip on the computing landscape. While not approaching Windows in numbers, Linux would easily be more popular than OS/X.

    Today’s users DO NOT want to waste their time on arcane, esoteric, and cabalistic CLI. They just want to log on and start using their PCs.

    Reply
    • @Dragonmouth,

      Absolutely agree! The convenience of GUI tools like Synaptic on Debian-based distros makes software management easy. While the CLI is powerful and is adopted by many users, such as developers and programmers, it’s all about making Linux accessible to everyone.

      Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.