[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to check whether a package has been installed

Rick Macdonald wrote:

Martin Paraskevov wrote:

rpm lets you check whether a packege has been installed.
is this possible to do with apt-get or some other tool as well?

Here are a couple, not to mention the various GUIs:

rickmlinux:~# dpkg --get-selections|grep apt
apt                                             install
apt-utils                                       install
aptitude                                        install
gnome-apt                                       install
synaptic                                        install

rickmlinux:~# dpkg -s apt Package: apt

Sorry, bad copy/paste job. This should be:

rickmlinux:~# dpkg -s apt
Package: apt
Status: install ok installed


Somebody else just offered "dpkg -l". I like that better because it shows the versions:

rickmlinux:~# dpkg -l|grep apt
ii  apt         Advanced front-end for dpkg
ii  apt-utils       APT utility programs
ii  aptitude     terminal-based apt frontend
ii  gnome-apt      0.4.7-1.2      graphical package manager
ii libpcap0 0.6.2-2 System interface for user-level packet captu ii libpcap0.7 0.7.2-7 System interface for user-level packet captu ii libpcap0.8 0.8.3-5 System interface for user-level packet captu
ii  synaptic       0.55+cvs200503 Graphical package manager

If you know the eact pavkage name you get to see the column headings:   ;-)

rickmlinux:~# dpkg -l apt
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name           Version        Description
ii  apt         Advanced front-end for dpkg

Status: install ok installed
Priority: important
Section: base
Installed-Size: 3664
Maintainer: APT Development Team <deity@lists.debian.org>
Architecture: i386
Replaces: libapt-pkg-doc (<< 0.3.7), libapt-pkg-dev (<< 0.3.7)
Provides: libapt-pkg-libc6.3-5-3.3
Depends: libc6 (>= 2.3.2.ds1-4), libgcc1 (>= 1:3.4.1-3), libstdc++5 (>= 1:3.3.4-1)
Suggests: aptitude | synaptic | gnome-apt | wajig, dpkg-dev, apt-doc
Description: Advanced front-end for dpkg
This is Debian's next generation front-end for the dpkg package manager.
It provides the apt-get utility and APT dselect method that provides a
simpler, safer way to install and upgrade packages.
APT features complete installation ordering, multiple source capability
and several other unique features, see the Users Guide in apt-doc.


Reply to: