How do I install gcc 4.8.4 on a Linux Ubuntu 14.04 machine?

I'm a total newb in the world of Linux and Ubuntu.

I have a VM with Ubuntu 14.04. It looks like GCC 4.8.2 already installed.

I need to upgrade this to GNU GCC 4.8.4. How do I do this?

Thanks in advance, JohnB
LVL 1
jxbmaSoftware ConsultantAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Seth SimmonsSr. Systems AdministratorCommented:
just run this....

sudo apt-get update
sudo apt-get upgrade gcc

give it a few min as it might update dependencies
just tried on my system and upgraded to 4.8.4

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jxbmaSoftware ConsultantAuthor Commented:
What version of Ubuntu are you running?
I just did as you suggested and I got updated to gcc version 4.9.2
Zephyr ICTCloud ArchitectCommented:
If you want to install a specific version of gcc you will have to download it and compile it yourself, you've upgraded to the latest gcc version in the Ubuntu repository. You can either use that or if you want the older version you can uninstall the version you've installed and install the older one.

Your gcc-version can be found here, just pick a mirror closest to you.

When downloaded, unpack it and compile/install it.

The unpacking, compiling process is something like this (ymmv):
Unpack:
tar xzf gcc-4.8.4.tar.gz

Open in new window

cd into the unpacked folder:
cd gcc-4.8.4/

Open in new window

Run configure from within the gcc dir:
./configure

Open in new window

Make:
make

Open in new window

Check for dependencies and install:
sudo checkinstall

Open in new window

rindiCommented:
If you are using a GUI version of Ubuntu you can also use synaptic, select GCC, then under "Force Version" you can select from a list of those versions that are available in the repositories of your distro. If you don't use Ubuntu with GUI, you can also do something similar from the terminal.

apt-cache showpkg <package-name>

That will output those versions that are available to you. If the version you need is available you can then install it via:

sudo apt-get install <package-name>=<version>

If the one you want isn't available in the repos, then as above, compile it yourself.

But as gcc is probably pretty central in the working of your distro, things can break. Do you really need a specific gcc version? Normally the newest available for your distro via upgrade should also be the best and the one to use.
Seth SimmonsSr. Systems AdministratorCommented:
yours upgraded to 4.9.2?
that's odd...i did it on 14.04 and it upgraded to 4.8.4

root@seth-virtual-machine:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 14.04.2 LTS
Release:	14.04
Codename:	trusty

root@seth-virtual-machine:~# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04)

Open in new window


what is the output of gcc -v ?
did you manually add additional repositories?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.