Monday, August 08, 2005

Upgrading GCC


Customer requirement made me do the one thing which I had screwed up successfully before.

Upgrade GCC.

I was scared to death to do that. Fortune knocked me in the form of my Scientist friend Vijai. The wise spoke thus:
I dont need to compile from sources. There will be ready-made materials available. Just install those. and Voila it will work

I was happy. So, here goes my knowledge transfer. I know its silly to the core to be happy about making a simple installation work. I am writing this blog to all those kind-hearted newbie homo-sapiens out there who think in my lines.

Status:
1. I am having gcc3.2.2 . I need gcc 3.3.2
2. I am using RHL 9.0 (no fixes/patches/upgrades done so far).

Procedure:
1. First, go to Rpm Finder . Search for "gcc 3.3.2".
2. Downlaod the x86 version of gcc 3.3.2 . It will be listed under Fedora's packages.
I got it from here
3. There are two ways to get it. Either right-click download, or use "wget" command. I used "wget" command.


$ wget ftp://fr2.rpmfind.net/linux/fedora/core/1/
i386/os/Fedora/RPMS/gcc-3.3.2-1.i386.rpm


4. Now, comes the main part. You need to verify if upgrading this package causes any problems in dependencies to you.
$ rpm -ivh --test gcc-3.3.2-1.i386.rpm

To me, it gave three dependency issues. I needed to have later versions of
"libgcc","binutils" and "cpp" packages than those already present.



5. I proceeded to download these packages and did the previous four steps for these.
6. But, upgrading/installing libgcc was creating problems as the older version of this libgcc was needed by gcc3.2.2 (the current version). Hence, I proceeded to uninstall the whole gcc package (cos this was running into loops).


$ rpm -e --nodeps gcc-3.2.2-5 


the "nodeps" options was a request to the "rpm" utility to ignore any dependency issues that may pop-up during the un-installation. I did this because I am going to anyway upgrade the package to the later one. Once this is done, the dependency issues will be solved.


7. So, then, I upgraded all the three packages..
$ rpm -ivh --test <rpm-of-package-to-install> 
- to test for any issues
$ rpm -ivh <rpm-of-package-to-install> 
- to install


8. Finally, I upgraded the latest gcc.
9. Using the "--test" is of paramount importance as this will save u from any embarassment later on. ALWAYS use this before proceeding with the real installation.

10. I am the now happy developer(is it???) with a first-in-my-lifetime successfull upgradation of GCC (of course with the help of our in-house scientist)

No comments: