what the equivalent for rpm -qa

Asked by qsummon on 2009-11-09

I want to query all the packages I have installed in the server is there any apt-?? function to do this?
I DO NOT not want to install RPM features in ubuntu
No GUI installed, server at level 3

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu dpkg Edit question
Assignee:
No assignee Edit question
Solved by:
qsummon
Solved:
Last query:
Last reply:
GaryW (gnubyexample) said : #1

dpkg --list
to list all packages installed*

dpkg -l | cut -d' ' -f3
to show the package names field only.

*If you want to ignore packages that are not fully installed or have been partially removed
then perhaps look at the following example which I just ran on my machine.

gnubyexample@amd754n:~$ dpkg -l | egrep '^ii' | cut -d' ' -f3 | grep apt
apt
apt-transport-https
apt-utils
apt-xapian-index
aptdaemon
aptitude
apturl
apturl-common
laptop-detect
laptop-mode-tools
libraptor1
python-apt
python-aptdaemon
python-aptdaemon-gtk
raptor-utils
synaptic
xserver-xorg-input-synaptics

The '^ii' grep bit limits your results to perhaps better match what --all option of rpm will give.

The example above is giving you a subset of all installed which include the string apt.

If you have aptitude installed then it will appear in that list when you repeat my example.

Having aptitude will give you a way of exploring packages
without having a gui available and is often used in console server setups.

Read up a bit on the web about aptitude perhaps and ensure you know
how to quit out before you go into it and start making package
install changes.

qsummon (qsummon) said : #2

COOL, this exactly what I need, cmd-line and I/O...
Thanks a lot Gary