一直觉得rpm包安装有点麻烦,下面记录个例子以作参考
我的suse 11里面的zypper安装库没有pcre-devel,通过rpm包管理方式安装一个
首先下载rpm安装包,找到对应suse 11的版本(下载地址)
root $rpm -i pcre-8.10-4.1.src.rpm root $cd /usr/src/packages/SPECS/ root $rpmbuild -bb pcre.spec root $cd /usr/src/packages/RPMS/x86_64/ root $ll total 912 -rw-r--r-- 1 root root 294991 Nov 24 09:06 libpcre0-8.10-4.1.x86_64.rpm -rw-r--r-- 1 root root 84699 Nov 24 09:06 libpcrecpp0-8.10-4.1.x86_64.rpm -rw-r--r-- 1 root root 32459 Nov 24 09:06 libpcreposix0-8.10-4.1.x86_64.rpm -rw-r--r-- 1 root root 173527 Nov 24 09:06 pcre-devel-8.10-4.1.x86_64.rpm -rw-r--r-- 1 root root 223358 Nov 24 09:06 pcre-doc-8.10-4.1.x86_64.rpm -rw-r--r-- 1 root root 114433 Nov 24 09:06 pcre-tools-8.10-4.1.x86_64.rpm root $rpm -i <package>.rpm
最后一步按照依赖关系先后安装各个rpm包,其中执行有些安装包可能出现如下错误
$rpm -i libpcrecpp0-8.10-4.1.x86_64.rpm
file /usr/lib64/libpcrecpp.so.0.0.0 from install of libpcrecpp0-8.10-4.1.x86_64 conflicts with file from package pcre-7.8-2.18.x86_64
执行:rpm -ivh libpcrecpp0-8.10-4.1.x86_64.rpm --replacefiles即可