Category: How to... — UbuntuLinuxHelp @ 12:18 pm —

A couple of days ago I turned my PC on and the BIOS failed to auto-detect my hard drive. Assuming it was just a boot-up mistake, I rebooted the system - I got the same result. Suffice it to say, it did not take to long to realize that my hard drive had failed!

I even tried using the Ultimate Boot CD (UBCD) tool from ultimatebootcd.com. UBCD is a great free diagnostic CD with lots of troubleshooting tools, I’ve used this tool often and highly recommend it.

The bad news, the degree of hard drive failure was not worth the excessive time to reclaim any data.
The good news, I had backups and could get my system back up and running in minutes!

How you ask? First install Ubuntu, as of the writing of this article, part one of my article “How to Install the Perfect Ubuntu Based Computer - Introduction” is available on this web site. I had previously made backups of my settings, package installations as well as email, and other important data.

Backing up important data is relatively easy! - Just burn it to a CD or DVD. That’s what I did to save email messages, documents, my home folder, fonts, etc.

What I needed was to preserve the installation packages installed (which I’d never remember and prefer not to write down). That would actually have taken me too long to figure out and I’d probably not have found them all!

Here’s how to ensure you get all your packages and applications back…

Run the command

sudo dpkg –get-selections > /backup/applist.txt

What this does is create a simple text listing of all the packages and applications installed on my system and stores it in my “backup” directory (which I created earlier). I can email that list, burn it to CD or do whatever I wish, so as to have a safe copy of it.

Restoring is a simple matter, install Ubuntu and copy your “applist.txt” file to “/backup”, then restore the packages using that backed up package list (applist.txt) like this:

cat /backup/applist.txt | sudo dpkg –set-selections

next:

sudo apt-get -y update

then:

sudo apt-get dselect-upgrade

Now your packages will be restored. Now I’m free to copy any data I wanted to save that was in my home directory; documents, images, audio files, etc.

Why is this so good to do? It saves a lot of time searching for the packages you need or want as well as keeping a listing of the ones I probably forgot I had installed and at most I may have lost a day or two of file changes. A real time-saver!

Sorry, no comments yet.

Write Your Comment

Comment Guidelines: Basic XHTML is allowed (a href, strong, em, code). All line breaks and paragraphs will be generated automatically.

You should have a name, right? 
Your email address, I promised I won't tell it to anyone. 
If you have a web site or blog, you can type the URL right here. 
This is where you type your comments. 
Remember my information for the next time I visit.