as5.4安装gcc和g++

在光盘中或者到网站上下载

kernel-headers-2.6.18-164.el5.i386.rpm

compat-glibc-headers-2.3.4-2.26.i386.rpm

compat-glibc-2.3.4-2.26.i386.rpm

compat-libstdc++-33-3.2.3-61.i386.rpm

compat-libf2c-34-3.4.6-4.i386.rpm
compat-libgcc-296-2.96-138.i386.rpm
cpp-4.1.2-46.el5.i386.rpm
glibc-headers-2.5-42.i386.rpm
glibc-devel-2.5-42.i386.rpm
libgomp-4.4.0-6.el5.i386.rpm
libstdc++-devel-4.1.2-46.el5.i386.rpm
gcc-4.1.2-46.el5.i386.rpm
compat-gcc-34-3.4.6-4.i386.rpm
compat-gcc-34-c++-3.4.6-4.i386.rpm

 

如果是光盘

请切换到安装光盘目录下:
cd /media
可以看到 RHEL* 的目录,然后切换到这个目录中:
cd RHEL*
你需要运行一下命令:
rpm --import RPM-GPG-KEY-redhat

准备好如下*.rpm文件(/media/RHEL*/Server/目录下会有)

添加对中文简繁体的支持,请运行
rpm -ivh fonts-chinese-3.02-12.el5.noarch.rpm

安装中文输入法 ,你需要运行以下系列命令:

rpm -ivh scim-libs-1.4.4-41.el5.i386.rpm
rpm -ivh scim-1.4.4-41.el5.i386.rpm
rpm -ivh scim-chinese-standard-0.0.2-1.el5.i386.rpm
rpm -ivh scim-tables-0.5.6-7.i386.rpm
rpm -ivh scim-tables-chinese-0.5.6-7.i386.rpm
rpm -ivh scim-pinyin-0.5.91-16.el5.i386.rpm

 

现在我们开始安装GCC依赖的*rpm程序:
1、准备好如下*.rpm文件(/media/RHEL*/Server/目录下会有),另外这个网址
http://riksun.riken.go.jp/pub/pub/Linux/slc/slc52/i386/yum/testing/
有很多*.rpm程序文件,非常丰富,请注意查看版本:

kernel-headers-2.6.18-164.el5.i386.rpm

compat-glibc-headers-2.3.4-2.26.i386.rpm

compat-glibc-2.3.4-2.26.i386.rpm

compat-libstdc++-33-3.2.3-61.i386.rpm

compat-libf2c-34-3.4.6-4.i386.rpm
compat-libgcc-296-2.96-138.i386.rpm
cpp-4.1.2-46.el5.i386.rpm
glibc-headers-2.5-42.i386.rpm
glibc-devel-2.5-42.i386.rpm
libgomp-4.4.0-6.el5.i386.rpm
libstdc++-devel-4.1.2-46.el5.i386.rpm
gcc-4.1.2-46.el5.i386.rpm
compat-gcc-34-3.4.6-4.i386.rpm
compat-gcc-34-c++-3.4.6-4.i386.rpm

然后必须按照顺序依次执行:

rpm -ivh kernel-headers-2.6.18-164.el5.i386.rpm

rpm -ivh compat-glibc-headers-2.3.4-2.26.i386.rpm

rpm -ivh compat-glibc-2.3.4-2.26.i386.rpm

rpm -ivh compat-libstdc++-33-3.2.3-61.i386.rpm

rpm -ivh compat-libf2c-34-3.4.6-4.i386.rpm
rpm -ivh compat-libgcc-296-2.96-138.i386.rpm
rpm -ivh cpp-4.1.2-46.el5.i386.rpm
rpm -ivh glibc-headers-2.5-42.i386.rpm
rpm -ivh glibc-devel-2.5-42.i386.rpm
rpm -ivh libgomp-4.4.0-6.el5.i386.rpm
rpm -ivh libstdc++-devel-4.1.2-46.el5.i386.rpm
rpm -ivh gcc-4.1.2-46.el5.i386.rpm
rpm -ivh compat-gcc-34-3.4.6-4.i386.rpm
rpm -ivh compat-gcc-34-c++-3.4.6-4.i386.rpm

执行完之后,执行gcc -v看一下版本

[root@localhost Server]# gcc -v

使用内建 specs。

目标:i386-redhat-linux
配置为:
../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
--with-cpu=generic --host=i386-redhat-linux
线程模型:
posix
gcc 版本 4.1.2 20080704 (Red Hat 4.1.2-46)


安装g++

rpm -ivh libstdc++-devel-4.1.2-48.el5.x86_64.rpm
rpm -ivh gcc-c++-4.1.2-48.el5.x86_64.rpm

查看g++版本

[root@localhost Server]# g++ -v
使用内建 specs。

目标:i386-redhat-linux
配置为:../configure --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info --enable-shared
--enable-threads=posix --enable-checking=release --with-system-zlib
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic
--host=i386-redhat-linux
线程模型:posix
gcc 版本 4.1.2 20080704 (Red Hat 4.1.2-46)

 

你可能感兴趣的:(gcc)