我的电脑上发生了一件非常奇怪的事情。我确实查找了类似的问题,但那里的解决方案并没有帮助我。
我正在尝试在 Cent OS 6.7 上安装 bazel 0.2.2b。Bazel 需要 gcc 4.8 或更高版本才能编译,因此我使用此处给出的步骤将我的 gcc 升级到 4.8.2 。
我在安装后启用了 scl ,但没有任何改变。我的默认 gcc 仍然是 4.4.7。所以我做了以下步骤:
sudo mv /usr/bin/gcc /usr/bin/gcc.bak
sudo cp /opt/rh/devtoolset-2/root/usr/bin/gcc /usr/bin/gcc
sudo mv /usr/bin/g++ /usr/bin/g++.bak
sudo cp /opt/rh/devtoolset-2/root/usr/bin/g++ /usr/bin/g++
由于删除 gcc 很危险,我将其移至另一个文件并将新文件复制到 /usr/bin/gcc。
现在,我的默认 gcc 和 g++ 都是 4.8.2 但我仍然收到错误:
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
当我./compile
安装 Bazel 时。
我尝试了其他类似问题中发布的解决方案,要求升级/重新安装但没有用。
$ yum install gcc-c++
Loaded plugins: fastestmirror, refresh-packagekit, security
You need to be root to perform this command.
[sree@ds1 bazel]$ sudo yum install gcc-c++
[sudo] password for sree:
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirror.atlanticmetro.net
* epel: mirror.cs.princeton.edu
* extras: mirror.cc.columbia.edu
* updates: centos.mirror.constant.com
Package gcc-c++-4.4.7-17.el6.x86_64 already installed and latest version
Nothing to do
我担心如果我做错任何事可能会破坏系统核心。我现在该怎么办?