LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to upgrade gcc in Debian 3.0r1 to v3.3.1 (https://www.linuxquestions.org/questions/linux-software-2/how-to-upgrade-gcc-in-debian-3-0r1-to-v3-3-1-a-108069/)

mkipper 10-24-2003 01:44 PM

How to upgrade gcc in Debian 3.0r1 to v3.3.1
 
Hello,

I am playing with Debian 3.0r1, trying to install MythTV onto it.
From a fresh install, I want to upgrade gcc to 3.3.1 from 2.96 that shipped with Debian, before I do anything, including compiling my kernel, and compiling MythTV.
I have completed the install, using:

$ ./configure --prefix=/usr/local/gcc-3.3.1
$ make
# make install

Then I changed /usr/bin/gcc to point to /usr/local/gcc-3.3.1/bin/gcc
Now I get crazy errors when recompiling the kernel. Errors are like:
stdarg.h: No such file or directory.
What else do I need to do to fully upgrade gcc?
Are there some important steps I have missed?

Thanks,
Michael

Bruce Hill 10-24-2003 05:23 PM

Debain uses APT (Advanced Packaging Tool) to upgrade it's packages with .deb files. The method you used is from another distibution. You really should do it "the Debian way." Read The Debian GNU/Linux 3.0 installation manual for your particular processor family to see how it's done http://www.debian.org/releases/stable/installmanual. And you should also read the APT How-To http://www.debian.org/doc/manuals/ap.../index.en.html while you're at it. If you actually read all of those two, you'll be busy for about one week :D

Basically, the gcc-3.3 package is in testing, so you will first need to change your sources.list file from stable to testing. Just open the file as root from a console with
# nano /etc/apt/sources.list and do either one of two things. You can just change all the words stable to testing, or you can duplicate all the entries and change stable to testing. If you make duplicates, be sure to comment out (put # in front of the lines) all of the entries for stable, and only leave the ones uncommented for testing. If you already have a x window system, then open a xterm and do it there. If not, you'll have to do it from console. And then as you type the deb-src lines, or whatever the longer lines are, your screen will probably make a return in the line. If so, when you try the next step, it will give an error. To prevent this, when you are editing and get that return, position your cursor in front of the new line made by the return, do a Ctrl+U to uncut the line, and then backspace to put all the text on one line. It will display a $ at the end of the line on your screen, but the file will be correct.

Next, do Crtrl+X to exit, then say Y to save changes, then enter and it will save the file at the same place you opened it from. You should be back at a root prompt # so that you can type
# apt-get update
after it updates your packages, then you do
# apt-get install gcc
and it will give you a list saying something like
The following extra packages will be installed:
which are the dependencies gcc needs,
Suggested packages:
which as far as I can tell don't get installed and you can ignore, and
The following NEW packages will be installed:
which will give you all you need for gcc.

After Debian has finished installing the packages, you should go back into /etc/apt/sources.list and either change testing back to stable, or comment out (put # in front of) the lines for testing, and uncomment (remove the # in front of) the lines for stable - depending upon which way you did this in the earlier steps. Unless of course, you want to upgrade your entire distribution from Woody (stable) to Sarge (testing), in which case you will do all of the above, except when you come to the part of
# apt-get install gcc
you will do
#apt-get dist-upgrade
instead. That will not only upgrade your gcc compiler to the 3.3 version, but it will upgrade all of your packages from stable to testing. I am using testing, and there is nothing that is not stable about it, in my opinion. Of course, you must use LQ, and any other forum, with the understanding that everything you read is just someone's opinion.

Please post back if this worked for you, and of course, pray that someone with more experience than I also comes to your aid ;)


All times are GMT -5. The time now is 01:38 AM.