1.安装gcc
首先到http://vault.centos.org/6.3/os/x86_64/Packages/下载用到的rpm包,包括:ppl-0.10.2-11.el6.x86_64.rpm 、cloog-ppl-0.15.7-1.2.el6.x86_64.rpm 、mpfr-2.4.1-6.el6.x86_64.rpm 、cpp-4.4.6-4.el6.x86_64.rpm 、kernel-headers-2.6.32-279.el6.x86_64.rpm 、glibc-headers-2.12-1.80.el6.x86_64.rpm 、glibc-devel-2.12-1.80.el6.x86_64.rpm 、libstdc++-devel-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
[root@localhost gcc_rpm]# rpm -ivh ppl-0.10.2-11.el6.x86_64.rpm
warning: ppl-0.10.2-11.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:ppl ########################################### [100%]
[root@localhost gcc_rpm]# rpm -ivh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm
warning: cloog-ppl-0.15.7-1.2.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:cloog-ppl ########################################### [100%]
[root@localhost gcc_rpm]# rpm -ivh mpfr-2.4.1-6.el6.x86_64.rpm
warning: mpfr-2.4.1-6.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:mpfr ########################################### [100%]
[root@localhost gcc_rpm]# rpm -ivh cpp-4.4.6-4.el6.x86_64.rpm
warning: cpp-4.4.6-4.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:cpp ########################################### [100%]
[root@localhost gcc_rpm]# rpm -ivh kernel-headers-2.6.32-279.el6.x86_64.rpm
warning: kernel-headers-2.6.32-279.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:kernel-headers ########################################### [100%]
[root@localhost gcc_rpm]# rpm -ivh glibc-headers-2.12-1.80.el6.x86_64.rpm
warning: glibc-headers-2.12-1.80.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:glibc-headers ########################################### [100%]
[root@localhost gcc_rpm]# rpm -ivh glibc-devel-2.12-1.80.el6.x86_64.rpm
warning: glibc-devel-2.12-1.80.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:glibc-devel ########################################### [100%]
[root@localhost gcc_rpm]# rpm -ivh gcc-4.4.6-4.el6.x86_64.rpm
warning: gcc-4.4.6-4.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:gcc ########################################### [100%]
以下两个可以不安装:
[root@localhost gcc_rpm]# rpm -ivh libstdc++-devel-4.4.6-4.el6.x86_64.rpm
warning: libstdc++-devel-4.4.6-4.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:libstdc++-devel ########################################### [100%]
[root@localhost gcc_rpm]# rpm -ivh gcc-c++-4.4.6-4.el6.x86_64.rpm
warning: gcc-c++-4.4.6-4.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:gcc-c++ ########################################### [100%]
即使该包安装成功,后续还是会出现同样的软件依赖包问题
软件包依赖性的问题,用nodeps属性一定能装上
rpm -Uvh *.rpm --nodeps --force
安装完成gcc后可以使用gcc -v查看是否安装成功
同样可以参考:
http://linux.chinaunix.net/techdoc/develop/2007/07/05/961887.shtml
2.安装expect之前,还需要安装tcl
a.下载源码包
wget http://nchc.dl.sourceforge.net/sourceforge/tcl/tcl8.4.11-src.tar.gz
b.解压缩源码包
tar xfvz tcl8.4.11-src.tar.gz
c.进入/soft/tcl8.4.11/unix 目录
a.执行sed -i "s/relid'/relid/" configure
b.执行./configure --prefix=/expect
c.执行make
d.执行make install
e.执行mkdir -p /tools/lib
f.执行cp tclConfig.sh /tools/lib/
g. 将/tools/bin目录export到环境变量
tclpath=/tools/bin
export tclpath
d.安装expect
进入/soft/expect-5.43目录
执行./configure --prefix=/tools --with-tcl=/tools/lib --with-x=no
如果最后一行提示:
configure: error: Can't find Tcl private headers
需要添加一个头文件目录参数
--with-tclinclude=../tcl8.4.11/generic,即
./configure --prefix=/tools --with-tcl=/tools/lib --with-x=no --with-tclinclude=../tcl8.4.11/generic
../tcl8.4.11/generic 就是tcl解压安装后的路径,一定确保该路径存在
执行make
执行make install
编译完成后会生在/tools/bin内生成expect命令
执行/tools/bin/expect出现expect1.1>提示符说明expect安装成功.
e.创建一个符号链接
ln -s /tools/bin/expect /usr/bin/expect
查看符号连接
ls -l /usr/bin/expect
lrwxrwxrwx 1 root root 17 06-09 11:38 /usr/bin/expect -> /tools/bin/expect
这个符号链接将在编写expect脚本文件时用到,例如在expect文件头部会指定用于执行该脚本的shell
#!/usr/bin/expect
创建符号链接后,可以使用which expect查出expect
参考:http://bluethink.iteye.com/blog/1079044
标签:gcc,x86,el6,100%,tcl,64,expect,rpm From: https://blog.51cto.com/u_15740686/5745319