转自http://blog.csdn.net/quantyongan/article/details/38494193,亲测可用
首先安装gcc需要相应的rpm依赖包,在安装系统的镜像文件中就有这些rpm包
首先在光驱中选择系统的安装包载入
如果桌面显示有如下的光驱
说明是已经载入了镜像,这时候,需要挂载一下镜像到mnt目录
先在/mnt中创建一个文件夹 cdrom
进入到 /mnt/cdrom目录进入到Packages目录
使用如下命令查找相应的rpm包
- glibc-common-2.12-1.80.el6.x86_64.rpm
- glibc-2.12-1.80.el6.x86_64.rpm
- glibc-headers-2.12-1.80.el6.x86_64.rpm
- glibc-devel-2.12-1.80.el6.x86_64.rpm
- kernel-headers-2.6.32-279.el6.x86_64.rpm
- libgcc-4.4.6-4.el6.x86_64.rpm
- libgomp-4.4.6-4.el6.x86_64.rpm
- nscd-2.12-1.80.el6.x86_64.rpm
- mpfr-2.4.1-6.el6.x86_64.rpm
- ppl-0.10.2-11.el6.x86_64.rpm
- cloog-ppl-0.15.7-1.2.el6.x86_64.rpm
- cpp-4.4.6-4.el6.x86_64.rpm
- gcc-4.4.6-4.el6.x86_64.rpm
- gcc-c++-4.4.6-4.el6.x86_64.rpm
- libstdc++-4.4.6-4.el6.x86_64.rpm
- libstdc++-devel-4.4.6-4.el6.x86_64.rpm
找到这些安装包之后,记住,一定要按照以下的顺序安装,否则可能会出现错误
rpm -ivh glibc-common-2.12-1.80.el6.x86_64.rpm
rpm -ivh kernel-headers-2.6.32-279.el6.x86_64.rpm
rpm -ivh libgcc-4.4.6-4.el6.x86_64.rpm
rpm -ivh glibc-2.12-1.80.el6.x86_64.rpm
rpm -ivh libgomp-4.4.6-4.el6.x86_64.rpm
rpm -ivh nscd-2.12-1.80.el6.x86_64.rpm
rpm -ivh glibc-headers-2.12-1.80.el6.x86_64.rpm
rpm -ivh glibc-devel-2.12-1.80.el6.x86_64.rpm
rpm -ivh mpfr-2.4.1-6.el6.x86_64.rpm
rpm -ivh ppl-0.10.2-11.el6.x86_64.rpm
rpm -ivh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm
rpm -ivh cpp-4.4.6-4.el6.x86_64.rpm
rpm -ivh gcc-4.4.6-4.el6.x86_64.rpm
rpm -ivh libstdc++-4.4.6-4.el6.x86_64.rpm
rpm -ivh libstdc++-devel-4.4.6-4.el6.x86_64.rpm
rpm -ivh gcc-c++-4.4.6-4.el6.x86_64.rpm
最后通过which命令或者rpm -q 查看一下GCC是否已安装:
结束后,最好是能够卸载镜像