How can I check in the terminal if a package is already installed?

asked 06 Jun '11, 02:14

Linux%20Jedi's gravatar image

Linux Jedi
accept rate: 0%

edited 06 Jun '11, 11:38

jeremy's gravatar image

jeremy ♦♦

If you know the exact package name or would like detailed information, you can use the -s flag to dpkg to report the status of the package:

dpkg -s packagename

If you don't know the exact package name or would like summary information, you can use the -l flag to dpkg:

dpkg -l partial_packagename_with_wildcards



answered 06 Jun '11, 09:36

jeremy's gravatar image

jeremy ♦♦
accept rate: 37%

edited 06 Jun '11, 09:37

? You did'nt specify the system ; on a RPM-based system, like Red Hat Enterprise / Mandriva / Fedora / Linux / Cent OS, you can

rpm -qa | grep packagename

On a debian-based system like Ubuntu

dpkg --list | grep packagename

On an archlinux system

pacman -Qs packagename1 packagename2 ...

Oh, and on a bsd box you may :

pkg_info | grep packagename


answered 06 Jun '11, 11:33

xaccrocheur's gravatar image

accept rate: 0%

While no package management system was in the description, he did tag the question with apt. I'm going to add the dpkg tag now.


(06 Jun '11, 11:38) jeremy ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 06 Jun '11, 02:14

Seen: 3,336 times

Last updated: 06 Jun '11, 11:38

powered by OSQA