How to know if a package is installed or not easily and quickly

Sometimes we need know if any package is installed in our system, and it is somewhat tedious to open our package manager to after several steps see if it is installed or not.

Here is the way easy and fast to do it from a terminal.

To find out if a package is available in the repositories, I opened a terminal and typed:

  • Arch Linux: pacman -Ss package
  • Fedora: yum search package
  • Debian / Ubuntu: apt-cache search package
  • OpenSUSE: zypper se package
  • Gentoo: emerge -S package
To know if a package is installed on our machine:

  • Arch Linux: pacman -Qs package
  • Fedora: rpm -qa | grep package
  • Debian / Ubuntu: dpkg -l | grep package
  • OpenSUSE: zypper se -i package
  • Gentoo: emerge -pv package

Easy, right?


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Vjnary said

    that is to know if a package is in the repositories, if you want to know if a package is installed ... in Debian
    dpkg -l | grep package

  2.   Fernando D. Bozzo said

    Here I send another form, also from the terminal, and more punctual, since the search one can find many packages that start the same:

    sudo apt-cache policy

    It not only says if it is installed, but also which version is installed and which one in the repositories.

  3.   There is no one here said

    Beware, for Gentoo the parameter is lowercase 's', not uppercase 'S', because 'S' searches within package titles and descriptions (a slower process) while 's' searches only in names. That is, to search for a certain package by a text, you would execute

    emerge -s package

    In a process similar to the one described by Vjnario for Debian. But to find out if a package is installed or not, and if so which version is installed, you can run

    emerge -pv package

    These blogs are supposed to be informative, not misleading. Be careful and find out well the information that you publish, to the extent that these things have to be corrected.

  4.   luqueti said

    fedora:
    rpm -qa | grep package

  5.   BatteryLaptop said

    Please mate can you make a new topic on Linux power saving.
    Thank you. It would be an important plus.

  6.   Let's use Linux said

    Thank you! It was my mistake ... it's fixed. Let them know if they detect anything else.
    Cheers! Paul.

  7.   Let's use Linux said

    Thanks for the data! We are also human ... the error has already been corrected.
    Regards. Paul.

  8.   xarer said

    That is bullshit because with synaptic it is much easier and more visual to know if a specific package is installed or not, it would be another thing to see at the same time if there are several packages installed

  9.   dariorodt said

    That's nothing ... In Unity you just write the name of the package (or part of it) in the Dash applications Lens and that's it ... you know at once if it's installed, and if you can't see if it's available ... wham ...!

  10.   Let's use Linux said

    Interesting! I did not know, I did not know it.

  11.   querveroz said

    In Arch Linux, to search inside the installed packages is with

    pacman -Qs package

  12.   Vjnary said

    no matter what failures ... the important thing is to learn ... thanks for your tutoring ... keep it up !!!!

  13.   Jose Luis Lopez de Ciordia said

    If you use Aptitude in Ubuntu and Debian instead of dpkg or apt-get, the result will tell you if it is installed (i), pending (p) ...

  14.   Let's use Linux said

    Good Jose!

  15.   Beelzebub said

    Since nobody talks about Slackware ... In Slackware it's very simple, just from the terminal you run: ls / var / log / packages

  16.   The master said

    You have touched a very important point

  17.   suleck said

    and in ubuntu? Oo

  18.   anon said

    In Ubuntu the command you indicate does not work, you only look for the name of the package to know if it exists or what it is called but it does not indicate if it is installed or not.

    1.    let's use linux said

      You have to use the second command indicated in the post:

      dpkg -l | grep package

      Cheers! Paul.

  19.   David said

    When you write the command dpkg -l it looks like it was a capital i, or a slash |

    on the subject: very good post, I'm getting into the world of debian 🙂

  20.   josegaleano said

    Thanks but in Opensuse with that command the version number does not appear,
    It would be very useful to me because I do not have access to the graphical environment.
    zypper list-updates -t package
    if it gives me the current version but only the packages that could be updated therefore the others do not appear ...
    Regards!

  21.   josegaleano said

    I just found the installed version number for OpenSuse
    zypper info packagename
    regards

  22.   asc sulca c said

    the command dpkg -l works | grep package, but what would happen if I don't open the package from the menu? This command would be tricking us