2

I am thinking of getting a VPS and using Ubuntu with it. I've installed linux on home servers and I almost always choose a very bare system and then install packages manually after the install is complete.

However for a VPS, some providers have pre-made images that can be used. If I were to use one of them, what is the easiest way of finding out/listing what is already installed, including things like locations and versions?

4 Answers 4

10

dpkg -l will give you a list of all the applications installed on a debian based box. For more info, check this page.

Also, dpkg -L <pkgname> shows the files installed for .

2
  • sorry for the late reply. that works great but what about for Red Hat based installs like CentOs?
    – blndcat
    Jul 24, 2009 at 16:56
  • @blindcat - just left an answer with the rpm-based answer
    – warren
    Oct 2, 2009 at 6:32
2

Some other useful tricks: if you install "debian-goodies", you'll have the "dpigs" command to display installed package sorted by disk space usage.

Another useful trick if you want to make several similar installations : use

dpkg --get-selections > installedpackages.txt

On the installed machine then transfer the file to the new machine, and

   cat installedpackages.txt | dpkg --set-selections 

Then do

apt-get -u dselect-upgrade

And wait :)

3
  • 1
    Useless use of cat detected; you can do just 'dpkg --set-selections < installedpackages.txt' ;)
    – janneb
    Jun 28, 2009 at 19:34
  • Rhaaa I knew it but I was too lazy to check, I just copied and pasted from my notebook :)
    – wazoox
    Jun 29, 2009 at 10:00
  • 1
    dpkg --get-selections | ssh othermachine dpkg --set-selections` works, too :) Jul 15, 2012 at 12:20
1

On CentOS/RHEL/Fedora/etc:

rpm -qa | sort

Query the rpm database for all packages, and put them in alphabetical order :)

Afterwards, I'd rely on using yum to manage the packages, rather than rpm directly, as it will also handle dependencies.

-4
sudo dpkg -l > packageslist
more packageslist
2
  • dpkg -l doesn't need superuser access.
    – janneb
    Jun 28, 2009 at 19:27
  • If u have superuser access it is better to get result
    – Rajat
    Jun 29, 2009 at 5:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .