[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: apt: exporting and importing list of installed packages



On Wed, Oct 15, 2003 at 01:48:06AM +0200, Jens Grivolla wrote:
> Hi,
> 
> I apparently have a lot of leftovers from old packages that did not
> get cleanly uninstalled, and am losing quite a bit of disk space for
> that.
> 
> I would therefore like to do a fresh install (backing up /home and
> /etc), but using my current selection of packages (which I just
> carefully verified).
> 
> Is there a way to dump my current selection to a file and read it back
> later?  I didn't find such an option in aptitude or any of the other
> tools.
> 
> Ciao
>    Jens
> 

I use this:

grep -E "^Package|Status:.+$" /var/lib/dpkg/status | \
  sed "s/Package:/\tPackage:/" | tr \\n \\t | sed "s/\t\t/\n/g" | \
  grep "install ok installed" | \
  sed "s/Package: \(.*\)\tStatus: install ok installed/\1/" | sort

You could save it to a file and maybe 'aptitude install `cat file`'.



Reply to: