Linux and Open Source

Rebuild/Upgrade your system with ease

With Fedora 7 now out, I am posed with the task of upgrading my operating system. The problem is I know I have a lot of applications installed that aren’t a part of the new Fedora. So I thought there had to be a way to do this more easily. Here’s what I do now.

I always have had a separate drive (that is mounted as /data) in my machines to be used to store data. This ensured that, in the event of a fatal OS crash, precious data would be safe. Also on this drive (in a directory called /data/rpms) are all of the rpms of programs (and their dependencies) I have used over the lifespan of Fedora Core 6.

With that drive in mind here’s what we’ll do. The first step is to tar up the /home/ directory. This will take a long time and can result in a rather large file. We’ll name that file home.tgz . Once the file is tarred, move it to /data so it’s safe. Now we’ll create a post-install script (which will be called system_update and be stored in /data). Here’s what the script will look like:

#! /bin/sh

#update the newly installed OS

yum -y update

#install the rpms from /data/rpms

rpm -i /data/rpms/*rpm

#copy and unpack the /home directory

cp /data/home.tgz / ; tar xf /home.tgz

#reboot

reboot

Run chmod u+x /system_update and then install the new OS making sure you DO NOT overwrite the /data drive.

With your OS installed and working you need to run your new script. But before you actually would run this script you will need to find out what the /data drive is called, create a new directory called /data, and mount that drive to the /data directory. NOTE: Add that drive into the new systems /etc/fstab so it is mounted at boot. Now issue the command /data/system_update and your machine should eventually reboot into a familiar system.

Would you roll your own shell script to ease an upgrade?

There might be some issues with configuration files held in ~/ directories depending upon what you migrate from and to. None of this is a guarantee of course. It has worked for me on a number of occasions. At times it has failed when trying to move from major release to major release. And of course if you are using a distribution like Ubuntu, you could modify this easily to use apt-get instead of yum.

Get IT Tips, news, and reviews delivered directly to your inbox by subscribing to TechRepublic’s free newsletters.

Jack Wallen

About Jack Wallen

A writer for over 12 years, Jack's primary focus is on the Linux operating system and its effects on the open source and non-open source communities.

Jack Wallen

Jack Wallen

Jack Wallen is an award-winning writer for Techrepublic and Linux.com. As an avid promoter/user of the Linux OS, Jack tries to convert as many users to open source as possible. His current favorite flavor of Linux is Bodhi Linux (a melding of Ubuntu and Enlightenment).

When Jack isn't writing about Linux he is hard at work on his other writing career -- writing about zombies, various killers, super heroes, and just about everything else he can manipulate between the folds of reality. You can find Jack's books on Amazon, Barnes & Noble, and Smashwords.

Outnumbered in his house one male to two females and three humans to six felines, Jack maintains his sanity by riding his mountain bike and working on his next books. For more news about Jack Wallen, visit his website Get Jack'd.