我对 CentOS 和 RPM 的经验有限,所以我可能会遗漏一些明显的东西,但我似乎无法弄清楚这一点...我正在尝试使用此处的说明将 Sphinx 安装到 Docker 映像中的 CentOS 6 中: http://sphinxsearch.com/docs/current/installing-redhat.html (不过,我尝试从源 RPM 安装而不是二进制文件)
我运行docker run -i -t centos:centos6 bash
CentOS 映像来运行,然后这是我尝试运行命令时得到的结果(与提供更多信息和跳过提示的说明略有不同):
[root@db60006ae258 /]# yum -y install postgresql-libs unixODBC
Loaded plugins: fastestmirror
Setting up Install Process
base | 3.7 kB 00:00
base/primary_db | 4.6 MB 00:37
extras | 3.4 kB 00:00
extras/primary_db | 34 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 3.3 MB 00:08
Resolving Dependencies
--> Running transaction check
---> Package postgresql-libs.x86_64 0:8.4.20-4.el6_7 will be installed
---> Package unixODBC.x86_64 0:2.2.14-14.el6 will be installed
--> Processing Dependency: libltdl.so.7()(64bit) for package: unixODBC-2.2.14-14.el6.x86_64
--> Running transaction check
---> Package libtool-ltdl.x86_64 0:2.2.6-15.5.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==========================================================================================================================================
Package Arch Version Repository Size
==========================================================================================================================================
Installing:
postgresql-libs x86_64 8.4.20-4.el6_7 updates 202 k
unixODBC x86_64 2.2.14-14.el6 base 378 k
Installing for dependencies:
libtool-ltdl x86_64 2.2.6-15.5.el6 base 44 k
Transaction Summary
==========================================================================================================================================
Install 3 Package(s)
Total download size: 624 k
Installed size: 1.8 M
Downloading Packages:
(1/3): libtool-ltdl-2.2.6-15.5.el6.x86_64.rpm | 44 kB 00:00
(2/3): postgresql-libs-8.4.20-4.el6_7.x86_64.rpm | 202 kB 00:00
(3/3): unixODBC-2.2.14-14.el6.x86_64.rpm | 378 kB 00:01
------------------------------------------------------------------------------------------------------------------------------------------
Total 234 kB/s | 624 kB 00:02
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <[email protected]>
Package: centos-release-6-7.el6.centos.12.3.x86_64 (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : libtool-ltdl-2.2.6-15.5.el6.x86_64 1/3
Installing : unixODBC-2.2.14-14.el6.x86_64 2/3
Installing : postgresql-libs-8.4.20-4.el6_7.x86_64 3/3
Verifying : postgresql-libs-8.4.20-4.el6_7.x86_64 1/3
Verifying : unixODBC-2.2.14-14.el6.x86_64 2/3
Verifying : libtool-ltdl-2.2.6-15.5.el6.x86_64 3/3
Installed:
postgresql-libs.x86_64 0:8.4.20-4.el6_7 unixODBC.x86_64 0:2.2.14-14.el6
Dependency Installed:
libtool-ltdl.x86_64 0:2.2.6-15.5.el6
Complete!
[root@db60006ae258 /]# rpm -Uhvv http://sphinxsearch.com/files/sphinx-2.2.10-1.rhel6.src.rpm
Retrieving http://sphinxsearch.com/files/sphinx-2.2.10-1.rhel6.src.rpm
D: ============== /var/tmp/rpm-tmp.Knfx7x
D: loading keyring from pubkeys in /var/lib/rpm/pubkeys/*.key
D: couldn't find any keys in /var/lib/rpm/pubkeys/*.key
D: loading keyring from rpmdb
D: opening db environment /var/lib/rpm cdb:mpool:joinenv
D: opening db index /var/lib/rpm/Packages rdonly mode=0x0
D: locked db index /var/lib/rpm/Packages
D: opening db index /var/lib/rpm/Name rdonly mode=0x0
D: read h# 155 Header sanity check: OK
D: added key gpg-pubkey-c105b9de-4e0fd3a3 to keyring
D: Using legacy gpg-pubkey(s) from rpmdb
D: Expected size: 4201741 = lead(96)+sigs(180)+pad(4)+data(4201461)
D: Actual size: 4201741
D: /var/tmp/rpm-tmp.Knfx7x: Header SHA1 digest: OK (f86024cbd050d0758ddb1aa0fc73c246deeb2f90)
D: added source package [0]
D: found 1 source and 0 binary packages
D: Expected size: 4201741 = lead(96)+sigs(180)+pad(4)+data(4201461)
D: Actual size: 4201741
D: InstallSourcePackage at: psm.c:244: Header SHA1 digest: OK (f86024cbd050d0758ddb1aa0fc73c246deeb2f90)
D: created directory(s) /root/rpmbuild mode 0755
D: created directory(s) /root/rpmbuild/SOURCES mode 0755
D: created directory(s) /root/rpmbuild/SPECS mode 0755
1:sphinx D: ========== Directories not explicitly included in package:
D: 0 /root/rpmbuild/SOURCES/
D: 1 /root/rpmbuild/SPECS/
D: ==========
warning: user builder does not exist - using root
warning: group builder does not exist - using root
D: fini 100644 1 ( 0, 0) 288 /root/rpmbuild/SOURCES/config.patch;56a3c57f unknown
warning: user builder does not exist - using root
warning: group builder does not exist - using root
D: fini 100664 1 ( 0, 0) 129584 /root/rpmbuild/SOURCES/libstemmer_c.tgz;56a3c57f unknown
warning: user builder does not exist - using root
warning: group builder does not exist - using root
D: fini 100664 1 ( 0, 0) 1064388 /root/rpmbuild/SOURCES/re2.tar.gz;56a3c57f unknown
warning: user builder does not exist - using root
warning: group builder does not exist - using root
########################################### [100%]
D: fini 100644 1 ( 0, 0) 3109250 /root/rpmbuild/SOURCES/sphinx-2.2.10-release.tar.gz;56a3c57f unknown
warning: user builder does not exist - using root
warning: group builder does not exist - using root
D: fini 100644 1 ( 0, 0) 2048 /root/rpmbuild/SOURCES/sphinx.init;56a3c57f unknown
warning: user builder does not exist - using root
warning: group builder does not exist - using root
D: fini 100644 1 ( 0, 0) 9647 /root/rpmbuild/SPECS/sphinx_rel22.spec;56a3c57f unknown
GZDIO: 527 reads, 4316100 total bytes in 0.021979 secs
D: closed db index /var/lib/rpm/Name
D: closed db index /var/lib/rpm/Packages
D: closed db environment /var/lib/rpm
[root@db60006ae258 /]# service searchd start
bash: service: command not found
[root@db60006ae258 /]# find / -name "searchd*"
[root@db60006ae258 /]#
答案1
源RPM(src.rpm)是使用RPM格式进行源码打包的。您可以使用它为您的计算机构建二进制包,或者将其用作自定义版本的起点。源 RPM 比二进制 RPM 更易于移植,但除非您知识渊博,否则我建议您不要走这条路。
检查 CentOS 页面,看看是否有适用于您的系统的二进制包,无论是官方包还是在经过审查的第三方存储库之一。请小心,一些更可疑的第三方存储库会覆盖核心包,并可能会破坏您的系统(或使其难以更新)。