5

I need to upgrade GCC. When I type yum install GCC it tells me Package gcc-4.1.2-51.el5.x86_64 already installed and latest version. Unfortunately I'm trying to install some software which requires GCC 4.3 minimum.

I checked out the possibility of installing GCC from source, but it looks very complicated!

How can I upgrade GCC to at least version 4.3 on CentOS?

studiohack
  • 13,468
  • 19
  • 88
  • 118
Alasdair
  • 847
  • 3
  • 11
  • 20
  • If you want to update the system gcc you should first establish that this will break nothing that relies on it. – Paul Dec 01 '11 at 05:56
  • Like what, for example? – Alasdair Dec 01 '11 at 05:57
  • GCC is just a compiler right? So why would applications use it. I thought it was just for compiling sources? – Alasdair Dec 01 '11 at 05:59
  • I am not entirely sure with Centos, but Centos expects system files to be the version that is issued - I would just add the "will it break stuff" query to your question so it gets addressed as well as the howto – Paul Dec 01 '11 at 06:01
  • Yes it is just a compiler, some distributions will recompile some updates. – Paul Dec 01 '11 at 06:08
  • Indeed, however certain applications require a minimum version of GCC to build successfully due to available features or known bugs in previous versions. Additionally, in theory anyway, a newer version of GCC is more likely to build a more efficient executable as the compiler designers improve and tweak the build processes. – Turix Feb 10 '12 at 11:15

2 Answers2

4

CentOS 5.x has the "gcc44" package containing GCC version 4.4.

janneb
  • 997
  • 6
  • 14
  • 1
    +1 - This is the workaround I have been using on my boxes, however it will require manual intervention in the future when 4.4 is moved into the main CentOS GCC rpm. – Turix Feb 10 '12 at 11:16
0

You could try Remi's repository. It usually has more up to date packages than the normal CentOS repository.

Charles
  • 450
  • 3
  • 12
elimirks
  • 133
  • 7
  • While Remi's repo has some good updates, it tends to focus on the PHP/MySQL ecosystem. It happens that there are no GCC updates there for CentOS 5 or 6. – Charles Nov 08 '12 at 06:52