如何在 CentOS 7.2 上使用 yum 安装 gcc 5.3? [英] How to Install gcc 5.3 with yum on CentOS 7.2?
问题描述
我使用的是 CentOS 7.2
I am using CentOS 7.2
当我使用yum groupinstall开发工具"
时,gcc版本是4.8.5,像这样:
When I use yum groupinstall "Development Tools"
, gcc version is 4.8.5, like this:
我想安装 gcc 5.3
I would like to install gcc 5.3
如何用 yum
解决这个问题?
How to approach this with yum
?
推荐答案
更新:
通常人们想要最新版本的 gcc,并且 devtoolset 正在保持最新,所以也许你想要 devtoolset-N,其中 N={4,5,6,7...},检查 yum 以获得最新的可用在您的系统上).为 N=7 更新了下面的 cmds.
Update:
Often people want the most recent version of gcc, and devtoolset is being kept up-to-date, so maybe you want devtoolset-N where N={4,5,6,7...}, check yum for the latest available on your system). Updated the cmds below for N=7.
以 devtoolset-7 的 gcc-7.2.1 包为例.首先,您需要启用 Software Collections,然后它在 devtoolset 中可用-7:
There is a package for gcc-7.2.1 for devtoolset-7 as an example. First you need to enable the Software Collections, then it's available in devtoolset-7:
sudo yum install centos-release-scl
sudo yum install devtoolset-7-gcc*
scl enable devtoolset-7 bash
which gcc
gcc --version
这篇关于如何在 CentOS 7.2 上使用 yum 安装 gcc 5.3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!