I have version 4.4.4 of gcc installed and would like to update to either a specific version or to the latest version. Here is what I have tried:

sudo yum install gcc-c++

this tells me that Package gcc-c++-4.4.4-10.fc12.i686 already installed and latest version (not true, there is at least a version 4.8 available).

Next I tried a specific version:

sudo yum install gcc-c++-4.8.1

with the result of No Package gcc-c++-4.8.1 available..

At last I tried to update the package with

sudo yum update gcc-c++

with the result No Packages marked for Update.

So how the heck do I update the version of gcc and/or gcc-c++ to be able to compile projects with C++11?

  • 2
    The gcc on the fedora 17 box I'm on now is 4.7.2, so fedora 18 is at least that. If you're really using F12 and you don't have a reason beyond laziness or "I'm scared of systemd", you should upgrade (or re-install if you can't upgrade that far). Since F12 reached end-of-life a few years ago, nothing in it will be updated any further. – goldilocks Apr 10 '13 at 19:11

The message already installed and latest version is referring to the latest version of the RPM (binary package) for the version of Fedora. It appears that you are using Fedora 12, which is quite outdated. Your best course of action is likely to upgrade to the latest version of Fedora first, then you will have a more recent version of GCC available (4.7.2).

It takes a while for major software like GCC to make it through a distribution's build and QA process. So if you absolutely must have GCC 4.8.1 now (which seems unlikely given the age of your distribution), then you'll probably either have to find a third-party package or build it from source yourself. Regardless, I'd still recommend upgrading Fedora to reduce dependency complications.

  • I was hoping for a non-upgrade answer. Well, I will consider this option. – Alex Apr 10 '13 at 18:50
  • I've edited my answer to provide some additional options. But they are likely to be more complicated than a distribution upgrade. – depquid Apr 10 '13 at 18:52
  • Also, keep in mind that if you keep your distribution up to date, then you will automatically get updates of packages (e.g. GCC 4.8) once they become available for the distribution. – depquid Apr 10 '13 at 19:48
  • It IS possible to upgrade to the new versions without doing the OS upgrade, but you'd have to probably commpile and package it from the source. Even then, there might be come shared library incompatibles that come into play. – mdpc Apr 11 '13 at 5:36
  • To echo the answer and most of the comments here, it is tough to update just the compiler without upgrading the OS. I have a system on Fedora 13 and have run into many issues with dependencies trying to build GCC 4.8 for the system. To start with you will have to get a newer version of GLibC, which will also require a newer compiler (see chicken and egg problem). I looked at some updated pre-built packages (like the newer devtoolset packages) and also ran into dependency issues. – Dusty Campbell Feb 23 '15 at 6:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.