Red Hat 6.3安装gcc gc++
首先安装gcc需要相应的rpm依赖包,在安装系统的镜像文件中就有这些rpm包
首先在光驱中选择系统的安装包载入
如果桌面显示有如下的光驱
说明是已经载入了镜像,这时候,需要挂载一下镜像到mnt目录
先在/mnt中创建一个文件夹 cdrom
$ mkdir /mnt/cdrom
$ mount /dev/cdrom /mnt/cdrom进入到 /mnt/cdrom目录
$ cd /mnt/cdrom进入到Packages目录
$ cd Packages使用如下命令查找相应的rpm包
$ ls -l |grep glibc
- 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
$ ls -l |grep kernel
- kernel-headers-2.6.32-279.el6.x86_64.rpm
$ ls -l |grep libgcc
- libgcc-4.4.6-4.el6.x86_64.rpm
$ ls -l |grep libgomp
- libgomp-4.4.6-4.el6.x86_64.rpm
$ ls -l |grep nscd
- nscd-2.12-1.80.el6.x86_64.rpm
$ ls -l |grep mpfr
- mpfr-2.4.1-6.el6.x86_64.rpm
$ ls -l |grep ppl
- ppl-0.10.2-11.el6.x86_64.rpm
$ ls -l |grep cloog
- cloog-ppl-0.15.7-1.2.el6.x86_64.rpm
$ ls -l |grep cpp
- cpp-4.4.6-4.el6.x86_64.rpm
$ ls -l |grep gcc
- gcc-4.4.6-4.el6.x86_64.rpm
- gcc-c++-4.4.6-4.el6.x86_64.rpm
$ ls -l |grep libstdc++-
- 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是否已安装:
$ which gcc $ rpm -q gcc
结束后,最好是能够卸载镜像
$ umount /mnt/cdrom/