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?

wzzrd
  • 10,409
  • 2
  • 35
  • 47
blndcat
  • 135
  • 6

4 Answers4

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 .

HK_
  • 407
  • 2
  • 5
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 :)

wazoox
  • 6,918
  • 4
  • 31
  • 63
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.

warren
  • 18,369
  • 23
  • 84
  • 135
-4
sudo dpkg -l > packageslist
more packageslist
jscott
  • 24,484
  • 8
  • 79
  • 100
Rajat
  • 3,349
  • 22
  • 29