安装vm tools--出错The path "/usr/bin/gcc" is not valid path to the gcc binary”


系统环境: ubuntu12.04
 
 
安装vm tools时出现如下问题
The path "/usr/bin/gcc" is not valid path to the gcc binary
 
解决方案:
#cat /proc/version
 
Linux version 3.2.0-29-generic (buildd@allspice) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012
 
可以看出12.04对应的是gcc 4.6.3
 
当前使用的gcc版本与系统不匹配
#gcc --version
gcc version 4.7.3
 
 
sudo apt-get install gcc-4.6
出现如下错误(我的当前机器安装了gcc-4.7):
The following packages have unmet dependencies:
gcc-4.6 : Depends: gcc-4.6-base (= 4.6.3-1ubuntu5) but 4.6.3-10ubuntu1 is to be installed
           Depends: cpp-4.6 (= 4.6.3-1ubuntu5) but 4.6.3-10ubuntu1 is to be installed
直接sudo apt-get remove gcc gcc-4.6-base  cpp-4.6可能网上有更好的方法
再重新sudo apt-get install gcc
ps:只要源的版本配置对了(12.04对应源precise),自动会安装对应的版本,12.04 <-对应-> gcc-4.6
 
gcc安装完成后,再重新安装vm tools,可以按原来的方法重新安装一遍,
亦可以运行
#sudo /usr/bin/vmware-config-tools.pl
 
 
原文地址:https://www.cnblogs.com/jasonleeee/p/3884161.html