centos7 rpm tar.gz2 安装实例

这几天很是衰,yum不能用,rpm又不小心删除了,那么如何安装rpm呢,网上找到方法是用rpm tar.gz2安装。

安装报错1

checking nspr.h usability... no
checking nspr.h presence... no
checking for nspr.h... no
configure: error: missing required NSPR / NSS header

解决:

./configure --prefix=/usr CPPFLAGS="-I/usr/include/nspr -I/usr/include/nss"(这是在cd rpm解压后的配置,要指定已安装的nspr,nss的位置)

结果:(已找到)

checking nspr.h usability... yes
checking nspr.h presence... yes
checking for nspr.h... yes
checking nss.h usability... yes
checking nss.h presence... yes
checking for nss.h... yes

checking sechash.h usability... no
checking sechash.h presence... no
checking for sechash.h... no
configure: error: missing required NSPR / NSS header

报错2:checking sechash.h usability... no
checking sechash.h presence... no
checking for sechash.h... no
configure: error: missing required NSPR / NSS header

解决:

./configure --prefix=/usr CPPFLAGS="-I/usr/include/nspr -I/usr/include/nss3"(这是在cd rpm解压后的配置,要指定已安装的nspr,nss的位置,nss3是我安装的位置,之前的nss不能用)

结果:

checking nspr.h usability... yes
checking nspr.h presence... yes
checking for nspr.h... yes
checking nss.h usability... yes
checking nss.h presence... yes
checking for nss.h... yes
checking sechash.h usability... yes
checking sechash.h presence... yes
checking for sechash.h... yes

checking for VFY_VerifyDigestDirect in -lnss3... yes
checking for NSS_InitContext in -lnss3... yes
checking magic.h usability... no
checking magic.h presence... no
checking for magic.h... no
configure: error: missing required header magic.h

报错3:

checking magic.h usability... no
checking magic.h presence... no
checking for magic.h... no
configure: error: missing required header magic.h

解决:./configure --prefix=/usr CPPFLAGS="-I/usr/include/nspr -I/usr/include/nss3 -I/usr/include/linux"(magic在usr/include/linux 下)

结果:

checking whether make supports nested variables... yes
checking how to create a pax tar archive... gnutar
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/usr/yumrpm/rpm-4.13.0':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

问题4:configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

解决:

./configure --prefix=/usr --host=x86_64 CPPFLAGS="-I/usr/include/nspr -I/usr/include/nss3 -I/usr/include/linux"

结果:

checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... no
checking dynamic linker characteristics... no
checking how to hardcode library paths into programs... immediate
checking for bison... bison -y
checking for gcc option to accept ISO C99... unsupported
configure: error: ISO C99 capable compiler required

安装过程继续解决报错问题:

1.换了一个rpm源码包(github上下载)

2.解决magic.h找不到问题:安装file.tar.gz包( https://lists.freebsd.org/pipermail/freebsd-questions/2005-September/098241.html     ftp://ftp.astron.com/pub/file/)

3.解决archive.h找不到问题:安装libarchive.tar.gz( http://www.linuxfromscratch.org/blfs/view/svn/general/libarchive.html)

4.解决configure: error: lua not present (--without-lua to disable)

(http://www.linuxquestions.org/questions/programming-9/rpm-build-syntax-error-near-unexpected-token-%60lua-'-931408/)

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值