Page 1 of 1

Will gcc be upgraded from version 4.8.5?

Posted: 2019/06/18 20:27:37
by greina
On CentOS 7, the `yum install` seems like limit `gcc` to version 4.8.5. I can use other repos to update to later versions, but wasn't sure why the main repo was so far behind. Can anyone comment? Thanks.

Re: Will gcc be upgraded from version 4.8.5?

Posted: 2019/06/19 01:09:11
by chemal
The system compiler will never be upgraded and no reputable repository will offer such upgrades, because doing so would break binary compatibility. If you want newer versions of gcc for your own programming work, they can be installed alongside the system compiler but do not replace it. See RH's devtoolset software collections. At the moment we are at devtoolset-8.1 which contains gcc 8.3.1. Rebuilds for CentOS are available.

Re: Will gcc be upgraded from version 4.8.5?

Posted: 2019/06/19 10:39:57
by jlehtone
RHEL/CentOS base repositories/images have to remain consistent and a lot depends on the compiler.

Same is much more noticeable with Python. Package management is done with 'yum'. Yum is python-2.7 code. If you replace python-2.7 with python-3.x, the yum will break. You cannot fix anything, if you cannot install/uninstall packages. You can upgrade core component only if you simultaneously upgrade all dependent components.

There is such upgrade. It is called RHEL-8. There will be CentOS-8 once it is done. They will have a GCC version X.Y for the next 10 years.

You can have two versions simultaneously, if they have different names or if you can control when they are found.
You cannot put file named "gcc" in /usr/bin because there is already system's gcc.
You can put it into another folder and put that folder first in your PATH, as long as that PATH is not visible to programs that expect the "gcc" to start system's version.


Repository centos-sclo-rh is still with devtoolset-8 that has GCC-8.2.1:

Code: Select all

# yum install centos-release-scl-rh
# yum install devtoolset-8-toolchain

# scl enable devtoolset-8 bash
# which gcc
/opt/rh/devtoolset-8/root/usr/bin/gcc
# exit
# which gcc
/usr/bin/gcc