Maintaining all packages when reinstalling the ubuntu OS?

Goh Lip g.lip at
Thu Jul 7 17:05:58 UTC 2011

On 07/08/2011 12:32 AM, Peng Yu wrote:
> Hi,
> I need to reinstall ubuntu 10.04 LTS on my machine. But I'd like to
> record what ubuntu packages are installed so that I can later on
> reinstall these packages easily. I'm wondering if there is a command
> to keep track of all the additional packages installed. It is better
> that this information is dumped into a file so that it can be read
> some other command to easily reinstall all these packages. Is there
> such commands for saving the packages info and reinstall the packages?

To save the packages and have them installed without downloading again..

sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install dpkg-dev
sudo cp /var/cache/apt/archives/*.deb /<some_file>
cd /<that_file>
sudo dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz

Burn <that_file> to cdrom as data.
At new installation,
sudo apt-cdrom add

Then install any wanted packages as recorded down by Avi's method.

Regards - Goh Lip

ps: to keep conf files, put back any saved conf files in the relevent 

More information about the ubuntu-users mailing list