Ask Your Question
3

What is the method for upgrading CentOS 7 cc to version 4.9.4?

asked 2022-10-15 11:00:00 +0000

djk gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-09-16 04:00:00 +0000

huitzilopochtli gravatar image

Assuming you want to upgrade the GCC (GNU Compiler Collection) on CentOS 7 to version 4.9.4, here are the steps:

  1. Enable the Software Collections (SCL) repository:

    sudo yum install centos-release-scl
    
  2. Install the devtoolset-3 package, which includes GCC 4.9:

    sudo yum install devtoolset-3
    
  3. Enable the devtoolset-3 environment by running:

    scl enable devtoolset-3 bash
    

    This will set up the environment variables necessary to use GCC 4.9.

  4. Verify that GCC 4.9 is being used:

    gcc --version
    

    You should see output similar to:

    gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)
    

    Note that the version number may be slightly different depending on updates.

If you want to make this version of GCC available system-wide without having to enable the devtoolset-3 environment each time, you can create a script to set up the environment variables and add it to your system's shell initialization script. For example, you could create a file called scl_enable.sh with the following contents:

#!/bin/bash
source scl_source enable devtoolset-3

Then add this line to your .bashrc file:

source /path/to/scl_enable.sh

Replace /path/to with the actual path to the scl_enable.sh file. This will automatically enable the devtoolset-3 environment every time you open a new shell session.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-10-15 11:00:00 +0000

Seen: 10 times

Last updated: Sep 16 '21