Take the 2-minute tour ×
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.

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 at 1:37
    
Is installing from source an option? –  Ketan Apr 20 at 1:37
    
yes i can install from source if needed. –  rivu Apr 21 at 23:38
add comment

1 Answer 1

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 \
    http://linuxsoft.cern.ch/cern/devtoolset/slc6-devtoolset.repo
install devtoolset
$ sudo yum install devtoolset-2
share|improve this answer
1  
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 at 23:38
add comment

Your Answer

 
discard

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.