apt now tracks which packages are manually installed vs. those which are automatically installed. A manually installed package is one where you explicitly requested it to be installed. When you run apt-get install foo
, then foo is marked as "manually installed". When, in order to satisfy the dependencies of foo, it also has to install bar, then bar is marked as "automatically installed". This is useful so that later, when you apt-get remove foo
, the system can know that you no longer need bar either.
Your method, using dpkg --get-selections
will lose this information. A better package list can be obtained by getting a list of just the manually installed packges:
aptitude search '~i!~M' -F %p
~i
means "installed packages". !~M
means "not automatically installed". -F %p
formats the output to be package names only.
When you install packages, they often prompt you for more configuration options. This is stored in the 'debconf' database. You may want to also backup this database. This database can be backedup and restored with debconf-get-selections
and debconf-set-selections
which will require the debconf-utils
package.