8

I want to save the list of packages that have installed. I figured it might be the best to list all and diff it with the default set.

Edit: Clarification: I don't want to get the list of installed packages that are installed at the moment. Rather I want to get the list of packages that I added since the default install.

Jorge Castro
  • 71,754

3 Answers3

5

Open the ISO CD image file with file-roller and extract the file:

casper/filesystem.manifest-desktop

It contains all packages that are installed after the installation.

Just keep in mind that you can also download updates and closed source software during the installation, so you'd have the check for those packages separately.

Ubuntu 12.04

In Ubuntu 12.04 the list is no longer available in a single file. Instead, you you need to unpack two files:

  1. filesystem.manifest
  2. filesystem.manifest-remove

and remove the packages in the latter from the former:

comm -3 <(cat filesystem.manifest | awk '{print $1}' | sort) <(cat filesystem.manifest-remove | sort) > default.txt

You can use this as basis to figure out, what has been added since the install (see this answer for details).

htorque
  • 64,798
4

either

sudo dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n

or

sudo sed -ne '/^Package: \(.*\)/{s//\1/;h;};/^Installed-Size: \(.*\)/{s//\1/;G;s/\n/ /;p;}' /var/lib/dpkg/status | sort -n

or

sudo dpkg --get-selections

will list all the packages.

Just re-route the output to a file. The 1st two lines will list it from smallest to largest with the size in front of the package name. The 3rd is in alphabetical order.

Fabby
  • 34,259
Rinzwind
  • 299,756
  • Hi @Rinzwind , your solution gives me all the packages installed right now as it gives the same no of packages with dpkg -l. But what if I want only those packages, which I installed after Ubuntu installation? I suppose, the number of those packages must be fewer than dpkg -l. – ddas Jul 07 '16 at 09:24
  • Have you ever deleted your cache? @ddas if not all your DEBs are in /var/cache/apt/archives/ – Rinzwind Jul 07 '16 at 13:54
0

I've extracted package marks for you from default Natty Live-CD http://dl.dropbox.com/u/1399037/default-packages

BTW, after updating from 10.04 -> 10.10 -> 11.04 I've lost ~96 default packages, and after reinstalling them, stability of my Natty system increased

Extender
  • 2,358