How can I update gcc to the latest version in Ubuntu 10.04?

119,117

Solution 1

I think you can get it by adding this PPA to your repositories:

https://launchpad.net/~ubuntu-toolchain-r/+archive/test

You can add the PPA by running

sudo add-apt-repository ppa:ubuntu-toolchain-r/test

After it's in the repositories (and after running apt-get update) you should be able to either 1) update to the latest version using apt-get upgrade, or possibly 2) you'll have it available as a separate package you need to you'll need to apt-get install. I'm not sure which is the case with this package.

Further information: Guide on how to add a PPA to your repositories.

Solution 2

Add https://launchpad.net/~ubuntu-toolchain-r/+archive/test to your repositories by running:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test

Then follow the steps on AskUbuntu to map gcc to the version you just installed.

In our case, you want to run:

sudo apt-get update
sudo apt-get install gcc-4.6
sudo apt-get install g++-4.6
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 20
sudo update-alternatives --config gcc
sudo update-alternatives --config g++

Solution 3

You don't get latest anything on LTS with the package manager. It's supposed to be stable with backported security updates. I'm not a fan of updating distros, I just reinstall and copy ~/

  
./configure
make
make install  

is the general procedure. Read the options in the configure script...you have to have a version installed to compile a new one. make install will probably mangle your current install.

suggestion: if you want "newest" then use "newest" - that's 11.10 at this point I think.

Share:
119,117

Related videos on Youtube

Daniel Ozean
Author by

Daniel Ozean

struct descriptionOf { int elligent_Developer; short list_of_proven_skills; long list_of_ambitions; long long int erest_in_various_technologies; double effort_in_achieving_skills_and_ambitions; float ing_innovator; char of_a_hands_on_doer; }goldenmean; Software Developer with work experience in areas of Video/Image processing and codecs,DSP and multimedia Systems,on DSP/Multicore processor architecures, for devices and applications in Consumer Electronics, Communications industry. Programming languages: C,C++,Matlab/Octave,Python,DSP or RISC assembly languages.

Updated on September 18, 2022

Comments

  • Daniel Ozean
    Daniel Ozean almost 2 years

    I have Ubuntu 10.04 32-bit with gcc 4.4.3 currently installed on it. I want to upgrade it to gcc 4.6.1.

    1. How to update using Ubuntu Package Manager:

      apt-get upgrade/install
      
    2. As a second option I downloaded the latest gcc snapshot file from:

      http://gcc.cybermirror.org/snapshots/LATEST-4.7/gcc-4.7-20110709.tar.bz2

    How do I configure, compile, and install it?

  • Daniel Ozean
    Daniel Ozean almost 13 years
    Have you mentioned updating Ubunut itself. That's not what I am looking for. I am looking to upgrade gcc installed on my ubuntu.
  • RobotHumans
    RobotHumans almost 13 years
    not a good idea and it may cause many problems later.
  • Nick
    Nick about 12 years
    +1, this worked for me. The last line needs code formated but it wasn't a big enough edit to allow the change.