yum 安装g++时,用yum list的程序名不是 g++,而是 gcc-c++,否则搜不到。
先list:
#yum list gcc-c++
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.finalasp.com
* extras: mirrors.versaweb.com
* addons: mirror.centos.org
* updates: centos.mbni.med.umich.edu
Available Packages
gcc-c++.x86_64 4.1.2-52.el5_8.1 updates
然后安装:
#yum install gcc-c++.x86_64
gcc:yum install gcc
yum install gcc-c++