由於之前安裝RedHat Enterprise Linux 5 時候只安裝了服務器環境 沒有安裝開發環境 導致 服務器 無法 編譯 代碼
只好重新安裝 gcc 了。
首先想到的是 用 yum 來安裝
運行: yum -y install gcc gcc-c++
提示 this system is not registered with RHN...
您的系統沒有在紅帽網絡上注冊...
yum有問題了。。。
蛋疼ing...
還是 老老實實的 cd 安裝。。。
mount /dev/cdrom /mnt *將光驅掛在到 mnt目錄
cd /mnt/Server *進入光驅目錄 注意大小寫!
依次執行:
[root@rhel5 Server]# rpm -ivh kernel-headers-2.6.18-53.el5.i386.rpm
[root@rhel5 Server]# rpm -ivh glibc-headers-2.5-18.i386.rpm
[root@rhel5 Server]# rpm -ivh glibc-devel-2.5-18.i386.rpm
[root@rhel5 Server]# rpm -ivh libgomp-4.1.2-14.el5.i386.rpm
[root@rhel5 Server]# rpm -ivh gcc-4.1.2-14.el5.i386.rpm
[root@rhel5 Server]# rpm -ivh libstdc++-devel-4.1.2-14.el5.i386.rpm
[root@rhel5 Server]# rpm -ivh gcc-c++-4.1.2-14.el5.i386.rpm
安裝完畢!
rpm -q gcc
提示:
gcc-4.1.1-52.el5
安裝成功!