linux 5 x64上安装基础软件的一些错误修复
因项目需要,以下为linuxas5上安装基础软件时一些错误修复,仅作备忘
1、安装zlib时出现错误
suroot
cd/dbra/app/softs/ruby-1.8.6-p114/ext/zlib
rubyextconf.rb--with-zlib-dir=/dbra/app/lib/zlib
make
makeinstall
[root@bflinuxzlib]#make
gcc-I.-I.-I/dbra/app/lib/ruby/lib/ruby/1.8/x86_64-linux-I.-DHAVE_ZLIB_H-DOS_CODE=OS_UNIX-I/dbra/app/lib/zlib/include-O3-DUSE_MMAP-fPIC-czlib.c
gcc-shared-ozlib.sozlib.o-L'.'-L'/dbra/app/lib/ruby/lib'-Wl,-R'/dbra/app/lib/ruby/lib'-L'/dbra/app/lib/zlib/lib'-Wl,-R'/dbra/app/lib/zlib/lib'-L.-rdynamic-Wl,-export-dynamic-lz-ldl-lcrypt-lm-lc
/usr/bin/ld:/dbra/app/lib/zlib/lib/libz.a(adler32.o):relocationR_X86_64_32against`alocalsymbol'cannotbeusedwhenmakingasharedobject;recompilewith-fPIC
/dbra/app/lib/zlib/lib/libz.a:couldnotreadsymbols:Badvalue
collect2:ld返回1
make:***[zlib.so]错误1
解决办法:
重新安装zlib-1.2.3.tar.gz
tar-zxvfzlib-1.2.3.tar.gz
cdzlib-1.2.3
./configure
viMakefile
找到CFLAGS=-O3-DUSE_MMAP
在后面加入-fPIC,即变成CFLAGS=-O3-DUSE_MMAP-fPIC
接下面步骤
make
makeinstall
2、安装openssl错误
suroot
cd /dbra/app/softs/ruby-1.8.6-p114/ext/openssl
rm-rf*.o,openssl.so,Makefile
rubyextconf.rb--with-openssl-dir=/dbra/app/lib/openssl
make
makeinstall
ossl_asn1.c:727:警告:传递参数1(属于‘ASN1_get_object’)时在不兼容的指针类型间转换
gcc-I.-I.-I/dbra/app/lib/ruby/lib/ruby/1.8/x86_64-linux-I.-DRUBY_EXTCONF_H=\"extconf.h\"-I/dbra/app/lib/openssl/include-fPIC-g-O2-cossl_x509cert.c
gcc-I.-I.-I/dbra/app/lib/ruby/lib/ruby/1.8/x86_64-linux-I.-DRUBY_EXTCONF_H=\"extconf.h\"-I/dbra/app/lib/openssl/include-fPIC-g-O2-cossl_x509req.c
gcc-I.-I.-I/dbra/app/lib/ruby/lib/ruby/1.8/x86_64-linux-I.-DRUBY_EXTCONF_H=\"extconf.h\"-I/dbra/app/lib/openssl/include-fPIC-g-O2-cossl_pkey_rsa.c
gcc-I.-I.-I/dbra/app/lib/ruby/lib/ruby/1.8/x86_64-linux-I.-DRUBY_EXTCONF_H=\"extconf.h\"-I/dbra/app/lib/openssl/include-fPIC-g-O2-cossl_pkey_dsa.c
ossl_pkey_dsa.c:Infunction‘ossl_dsa_initialize’:
ossl_pkey_dsa.c:141:警告:传递参数1(属于‘PEM_ASN1_read_bio’)时在不兼容的指针类型间转换
ossl_pkey_dsa.c:141:警告:传递参数4(属于‘PEM_ASN1_read_bio’)时在不兼容的指针类型间转换
ossl_pkey_dsa.c:Infunction‘ossl_dsa_to_public_key’:
ossl_pkey_dsa.c:313:警告:传递参数2(属于‘ASN1_dup’)时在不兼容的指针类型间转换
gcc-I.-I.-I/dbra/app/lib/ruby/lib/ruby/1.8/x86_64-linux-I.-DRUBY_EXTCONF_H=\"extconf.h\"-I/dbra/app/lib/openssl/include-fPIC-g-O2-cossl_hmac.c
gcc-shared-oopenssl.soossl_engine.oossl_bio.oossl_config.oossl_x509revoked.oossl_bn.oossl_cipher.oossl_x509.oossl_pkcs7.oossl_x509ext.oossl_rand.oossl.oossl_pkey_dh.oopenssl_missing.oossl_ssl.oossl_x509attr.oossl_x509name.oossl_digest.oossl_x509store.oossl_pkcs12.oossl_ns_spki.oossl_x509crl.oossl_ocsp.oossl_pkey.oossl_asn1.oossl_x509cert.oossl_x509req.oossl_pkey_rsa.oossl_pkey_dsa.oossl_hmac.o-L'.'-L'/dbra/app/lib/ruby/lib'-Wl,-R'/dbra/app/lib/ruby/lib'-L'/dbra/app/lib/openssl/lib'-Wl,-R'/dbra/app/lib/openssl/lib'-L.-rdynamic-Wl,-export-dynamic-lssl-lcrypto-ldl-lcrypt-lm-lc
/usr/bin/ld:/dbra/app/lib/openssl/lib/libssl.a(s2_meth.o):relocationR_X86_64_32against`alocalsymbol'cannotbeusedwhenmakingasharedobject;recompilewith-fPIC
/dbra/app/lib/openssl/lib/libssl.a:couldnotreadsymbols:Badvalue
collect2:ld返回1
make:***[openssl.so]错误1
解决办法:重新编译openssl
3、安装oci8错误
LoadError:/oracle/app/product/10.2.0/db_1/lib/libnnz10.so:cannotrestoresegmentprotafterreloc:Permissiondenied-/dbra/app/lib/ruby/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.2/lib/oci8lib.so
from/dbra/app/lib/ruby/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.2/lib/oci8lib.so
from/dbra/app/lib/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in`require'
from/dbra/app/lib/ruby/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.2/lib/oci8.rb:20
from/dbra/app/lib/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in`gem_original_require'
from/dbra/app/lib/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in`require'
from(irb):2
[root@bflinuxdbra]#gemlist
***LOCALGEMS***
actionmailer(2.0.2)
actionpack(2.0.2)
activerecord(2.1.0,2.0.2)
activerecord-oracle-adapter(1.0.0.9250)
activerecord-oracle_enhanced-adapter(1.1.8)
activeresource(2.0.2)
activesupport(2.1.0,2.0.2)
cgi_multipart_eof_fix(2.5.0)
daemons(1.0.10)
fastthread(1.0.1)
gem_plugin(0.2.3)
gettext(1.93.0)
hoe(1.8.2)
log4r(1.0.5)
mongrel(1.1.4)
mongrel_cluster(1.0.5)
net-sftp(2.0.1)
net-ssh(2.0.3)
rails(2.0.2)
rake(0.8.3)
ruby-oci8(1.0.2)
ruby-prof(0.7.3)
rubyforge(1.0.1)
解决办法:
#ThisfilecontrolsthestateofSELinuxonthesystem.
#SELINUX=cantakeoneofthesethreevalues:
#enforcing-SELinuxsecuritypolicyisenforced.
#permissive-SELinuxprintswarningsinsteadofenforcing.
#disabled-SELinuxisfullydisabled.
#SELINUX=enforcing
SELINUX=disable
#SELINUXTYPE=typeofpolicyinuse.Possiblevaluesare:
#targeted-Onlytargetednetworkdaemonsareprotected.
#strict-FullSELinuxprotection.
SELINUXTYPE=targeted
[root@bflinux~]#setenforce0
irb(main):001:0>require'oci8'
=>true
其实在上面出现Permissiondenied时,也可以执行
#chcon-ttexrel_shlib_t$ORACLE_HOME/lib/*.so