Getting list of installed packages for later re-installation

Felipe Figueiredo philsf at ufrj.br
Thu Jul 6 01:49:22 UTC 2006


Even though good answers have already been given, I decided to add something 
here. (not much of a solution though)

On Tuesday 04 July 2006 15:43, Alexander Skwar wrote:
> Hello!
>
> To (maybe) fix my problems with Dapper, I'd like to reinstall Dapper.
> After finishing the installation, I'd like to re-install all the
> now missing packages and remove the unneeded packages, so that I'll
> have all the packages installed, that I've now got installed. What's
> the best way to do this?
>
> To get a list of the installed packages, I wanted to do:
>
> 	dpkg -l | awk '{print $2}' > ListOfInstalledPackages.txt
>
> And to later reinstall those packages, I tought about:
>
> 	apt-get install `cat ListOfInstalledPackage.txt`
>
> Will this work? Will this install all those packages that are missing
> from the new installation? How about removing the unneeded packages -
> will they be removed? Because of the "install" command, I "suspect" not :)

No, it won't. The package name "field", as reported by dpkg -l, have a limited 
size (although maybe it can be changed) and if package names exceed it, bad 
things can happen (from nothing at all to messing with "innocent" packages). 

I discovered this fact while trying to purge packs that left rc's after 
removal. 

Try this: 

$ dpkg -l xserver-xorg-driver*  

regards
FF




More information about the ubuntu-users mailing list