Tuesday, October 6, 2009

HowTo: BackUp and Restoring Deb/Packages on Ubuntu [Offline restoring]

This is howto guide for *buntu box users to BackUp all installed deb packages and Restoring/installing them quickly and efficiently no need to download again again when reinstalling the OS.

HowTo: BackUp and Restoring Deb/Packages on Ubuntu [Offline restoring]

Features and Uses:
  • No need to download your favourite applications and other required basic things when reinstalling *buntu box
  • This become very useful when you want to install and set same setting for multiple computer's on you school,Company or other places.
  • No need to get very large amount size of update's every time you reinstalling ubuntu. (If you already updated).
There is no real reason to do this if you are already doing a full system backup (e.g. an image of your Ubuntu partition using partimage). This is just something I discovered and feel could be beneficial to other users.

This comments will do that for you:

todo this backup you need to install a small utility named dpkg-repack fakeroot on your *buntu box.
to install fakeroot run this command on terminal
sudo apt-get install dpkg-repack fakeroot
 after that select place for backup, This may be a extranal drive,ThumpDrive or CD/DVD any thing you want. navigate to selected place using cd commend on terminal. Like this
let assume you are saving all backup deb files to "Backup"(this is foldename you haveto save your debfiles) folder on another partition of the same harddisk named "MyDisk"

cd /media/MyDisk; mkdir Backup

Filnally we are ready to backup
$ fakeroot -u dpkg-repack `dpkg --get-selections | grep install | cut -f1`
This code will take some time to finish. (copy the code except $)

Now if you scroll to "MyDisk", you should find a folder called "Backup" which should have all the deb files of all your installed packages.

Re-Installing of Backup:

Reinstalling is so easy, first navigate to your backup folder using cd command on terminal, and then type sudo dpkg -i *.deb in terminal


Examble:

cd /media/MyDisk/Backup
sudo dpkg -i *.deb
the first code will navigate to backup folder, second code will install all deb packages automatically.

Thats it. Now you have a all packages on you hand.

If you have to say somthing, tell me via comment.

1 comment:

  1. that is a great tutorial.
    It's gonna save me hours of **** around.
    thankyou very much

    ReplyDelete