Restore old packages on new install

It happens to me a lot that i get a new laptop or machine for half a year or so and i have to use that. Being a sysadmin, i am lazy so i hate installing everything again and again.

I take occasional backups of my configurations files, manage configurations in small files than a huge file so like the concept of *.conf.d directory. Here is what i do to restore my packages:

aptitude --display-format '%p' search '?installed!?automatic' > ~/machine_name-date-packages
sudo xargs aptitude --schedule-only install < old-list-of-packages ; sudo aptitude install

Then i go to sleep for couple of hours, after i wake up, i copy homedir and other backups and voilla, everything is like it was on other machine.

Tags: , , , , , , , ,

Leave a Comment