Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an RHEL 6 server with gcc version 4.4.7. I wanted to update the gcc version (I think the current one is 4.8). Yum update doesn't work. Also, SO answers for a similar question on CentOS does not work. I followed the methods in the accepted answer, the output is "Error getting repository data for testing-1.1-devtools-6, repository not found". Also I am not sure whether I should follow the methods for CentOs.

Has anyone updated gcc in RHEL 6 x86_64 server?

share|improve this question
Did you try to install it from this repo? hop5.in/yum/el6/repoview/gcc.html. These are binary builds of 4.8.2. You'll likely need to be at 6.4 CentOS to install them, which might be your issue. – slm Apr 20 '14 at 1:37
Is installing from source an option? – Ketan Apr 20 '14 at 1:37
yes i can install from source if needed. – rivu Apr 21 '14 at 23:38
up vote 0 down vote accepted

The easiest method by far is to make use of a binary build that's provided through a YUM repository. One such option would be to use the hop5.inrepository. Specifically this page: gcc - Various compilers (C, C++, Objective-C, Java, ...). They're providing 4.8.2 which should work with CentOS 6.3 or 6.4. You might want to do an update prior:

$ sudo yum update

The other option would be to make use of the Developer Toolset, specifically the bundled version provided by Scientific Linux.

Following the installation instructions you'll basically do the following 2 steps:

add repository
$ sudo wget -O /etc/yum.repos.d/slc6-devtoolset.repo \
install devtoolset
$ sudo yum install devtoolset-2
share|improve this answer
I tried to install the rpm downloaded from the first link, says "error: Failed dependencies: cpp = 4.8.2-8.el6 is needed by gcc-4.8.2-8.el6.x86_64 ...". For the developer toolset, it says "people.centos.org/tru/devtools-1.1/6Server/x86_64/RPMS/repodata/…: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found". I think the problem is it is 6Server instead of 6 in the link. I don't know how to fix that. – rivu Apr 21 '14 at 23:38

you can attempt gcc source buid.GCC requires MPC , MPFR and GMP as pre requisites.For GCC 4.8 , The version dependencies are MPC 0.8 GMP 6.0 MPFR 2.4.2.Down load the source packages , and install all packages under /usr/lib.The order of installation is gmp,mpfr,mpc

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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