How to find out if the package is installed in Linux

Linux packages are just a collection of software and the way they are installed varies depending on the distribution. There are several ways to quickly check if a package is currently installed.

Linux packages are just a collection of software and the way they are installed varies depending on the distribution. There are several ways to quickly check if a package is currently installed. Whether you are comfortable using the terminal or prefer a more intuitive approach, here is how you can check if the package is installed in Linux.

Use the package manager

Every Linux distribution includes a package manager. As the name suggests, this is the software you use to install or remove software packages. They also include commands that allow you to see if certain packages have been installed.

On Debian and Ubuntu distributions, you can check all installed packages with the following command:

 apt list --installed 

If you want to find a specific package, add the package name after the --installed flag . For example:

 apt list --installed nano 

Picture 1 of How to find out if the package is installed in Linux

If the package is installed, you will see a brief line with the package name and the version number installed. Packages that have not been installed will not appear.

You can also use dpkg to check installed packages by typing:

 dpkg -s packagename 

This command will give you a description of the package, including its version and capacity, but it will also show whether it is installed or not.

Picture 2 of How to find out if the package is installed in Linux

Arch Linux users can check with pacman, the Arch package manager. Open a terminal and enter:

 pacman -Qs packagename 

If using Fedora, you can find the same thing by using dnf and typing:

 dnf list packagename 

These commands will ask you to know the name of the package you're looking for, but certain package managers, like dnf, allow you to use wildcards like * to help search.

Use 'which' or 'has' on any Linux distribution

There are other ways to use the terminal and find out if the package is installed or not.Which command, for example, tells you the installation location of any package.

For example, if you search for sudo, it will display the location of sudo in '/ usr / bin / sudo'. To use it, enter:

 which packagename 

Replace packagename with the name of the package you want.

Picture 3 of How to find out if the package is installed in Linux

Alternatively, you can also use a third party solution called has.

You can install it directly on your Linux machine or. If you trust the script, run it directly from the Internet. You need to have curl installed to be able to do this. Open a terminal and enter:

 curl -sL https://git.io/_has | bash -s packagename1 packagename2 

You can check one or several packages at once. Just replace packagename with the name of the package you want.

Picture 4 of How to find out if the package is installed in Linux

Installed packages will have a green tick next to the version number. Uninstalled packages are displayed with a red cross.

Intuitive method to check installed packages

If you want to avoid the terminal, most Linux package managers come with a GUI replacement to perform the same task.

One of the best and works on many distributions, is GNOME Software. This tool will work with different package managers like apt or pacman and comes preloaded with Ubuntu.

Picture 5 of How to find out if the package is installed in Linux

GNOME has a simple GUI with the 'Installed' section, listing the software installed on the PC, although it does not list the packages.

If you need more detailed information, Debian and Ubuntu-based distributions can use the Synaptic Package Manager . This is a GUI wrapper for apt, which allows you to search and install packages, as well as view installed packages.

Picture 6 of How to find out if the package is installed in Linux

Installed packages will be displayed with a green checkbox next to the package name, as well as the package version, listed in the 'Installed Version' category.

You may need to install it first (this will involve opening the terminal), but the installation is very quick. Open a terminal and enter:

 sudo apt install synaptic 

Arch Linux users have many GUI wrappers for pacman, Arch's package manager, to choose from. You can learn more about these from the Arch Linux wiki.

Easily identify installed packages

One of the biggest benefits of Linux is the choice. You can go back to the package manager in the distro or use third-party solutions like finding out if the package has been installed.

If you are uncomfortable using a terminal, you can use your GUI to check for installed packages instead. Some of the best Linux distributions for beginners make it easy to completely avoid the terminal, thanks to their own GUI software installers like GNOME Software.

Which method do you like? Let everyone know in the comments below!

Update 28 September 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile