Friday, 6 June 2008

Howto Backup all installed programs/packages in Ubuntu/Kubuntu

PROBLEM: Lets say you have set up your *buntu box. Now you want to backup all the installed deb files so that you can restore them quickly and efficiently.


These commands will do that for you.

Open a terminal and paste the following into it:

$ sudo apt-get install dpkg-repack fakeroot

$ mkdir ~/dpkg-repack; cd ~/dpkg-repack

$ fakeroot -u dpkg-repack `dpkg --get-selections | grep install | cut -f1`

(the last command will take some time)

Now if you scroll to your home folder, you should find a folder called "dpkg-repack" which should have all the deb files of all your installed packages.

Reinstall Packages

If you want to re-install the packages, navigate to the folder with the packages and input the following command in the terminal:

sudo dpkg -i *.deb

2 comments:

Pastor Evon Smith said...

Thanks for the info. it was really helpful.

charas_override said...

Hi friend, thanks for the post, it was helpful, but I got a doubt, does this backup also the manually installed packages or just the ones installed by apt-get?