Re: [Hampshire] Installed packages list - Debian

Top Page

Reply to this message
Author: Peter Salisbury
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] Installed packages list - Debian
On Friday 21 Sep 2007, Jack Knight (OSM EU) wrote:
> Keith Edmunds wrote:
> > For the future, you might want to run something like this in a
> > daily cron job:
> >
> >     dpkg --get-selection > /etc/package.selections

>
> Sorry to nitpick, but this should read:
>
> dpkg --*get-selections* > /etc/package.selections
> ____________________^
>
> apart from that small typo, this is a *very* useful tip! Thanks
> Keith.
>
> jfk
>
> > Put it somewhere where it will be picked up by your backups.
> > Then, if this happens again, you can do
> >
> >     dpkg --set-selections < /etc/package.selections &&\
> >         apt-get dselect-upgrade

> >
> > to reinstall all your previously-installed packages. If you
> > restore /etc before doing that, you can keep your existing
> > configuration settings and UID/GIDs, etc.
> >
> > Keith


Just to extend the tip, if you use aptitude it keeps a record of which
packages were installed automatically rather than manually. This
information is kept in /var/lib/apt/extended_states [1]. Following a
post-disaster re-install of the (same!) packages you can copy an
archived version of this file to reinstate the automatic/manual
status of the packages.

HTH, Peter

[1] Here is a random extract from the file:

Package: libvorbis0a
Auto-Installed: 1

Package: ladcca2
Auto-Installed: 1

Package: compiz-core
Auto-Installed: 0