在CentOS 5.X上安装libxml2 2.7.X


9

CentOS随附libxml2-2.6.26。我必须至少安装2.7.X版本。

我从XMLSOFT(http://xmlsoft.org/sources/)下载了libxml2,libxml2-devel和libxml2-python(2.7.8)的RPM 。

我正在尝试以这种方式安装它:

# yum localinstall libxml2-2.7.8-1.x86_64.rpm libxml2-devel-2.7.8-1.x86_64.rpm libxml2-python-2.7.8-1.x86_64.rpm

我得到:

Examining libxml2-devel-2.7.8-1.x86_64.rpm: libxml2-devel-2.7.8-1.x86_64
Marking libxml2-devel-2.7.8-1.x86_64.rpm as an update to libxml2-devel-2.6.26-2.1.2.8.el5_5.1.x86_64
Examining libxml2-python-2.7.8-1.x86_64.rpm: libxml2-python-2.7.8-1.x86_64
Marking libxml2-python-2.7.8-1.x86_64.rpm as an update to libxml2-python-2.6.26-2.1.2.8.el5_5.1.x86_64
Resolving Dependencies
--> Running transaction check
---> Package libxml2.x86_64 0:2.7.8-1 set to be updated
--> Processing Dependency: libc.so.6(GLIBC_2.7)(64bit) for package: libxml2
---> Package libxml2-devel.x86_64 0:2.7.8-1 set to be updated
---> Package libxml2-python.x86_64 0:2.7.8-1 set to be updated
--> Processing Dependency: python(abi) = 2.6 for package: libxml2-python
--> Processing Dependency: libpython2.6.so.1.0()(64bit) for package: libxml2-python
--> Running transaction check
---> Package libxml2.x86_64 0:2.7.8-1 set to be updated
--> Processing Dependency: libc.so.6(GLIBC_2.7)(64bit) for package: libxml2
---> Package python26.x86_64 0:2.6.5-6.el5 set to be updated
---> Package python26-libs.x86_64 0:2.6.5-6.el5 set to be updated
--> Finished Dependency Resolution
libxml2-2.7.8-1.x86_64 from /libxml2-2.7.8-1.x86_64 has depsolving problems
  --> Missing Dependency: libc.so.6(GLIBC_2.7)(64bit) is needed by package libxml2-2.7.8-1.x86_64 (/libxml2-2.7.8-1.x86_64)
Error: Missing Dependency: libc.so.6(GLIBC_2.7)(64bit) is needed by package libxml2-2.7.8-1.x86_64 (/libxml2-2.7.8-1.x86_64)
 You could try using --skip-broken to work around the problem
 You could try running: package-cleanup --problems
                    package-cleanup --dupes
                    rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package.

是否也可以安全更新glibc?还是从源代码安装libxml2?

Answers:


13

确保已安装开发工具:

yum groupinstall "Development Tools"

抓住src rpm:

wget http://xmlsoft.org/sources/libxml2-2.7.8-1.src.rpm

由于rpm版本不同,您将无法直接调用rpmbuild,因此请短路:

rpm -ivh libxml2-2.7.8-1.src.rpm --nomd5

然后:

rpmbuild -ba /usr/src/redhat/SPECS/libxml2.spec

此时可能会提示您提供一些依赖项(如果是,则仅yum install是有问题的依赖项,然后重新运行rpmbuild -ba上面的命令)。

假设您的构建成功完成(我刚刚在此处的CentOS 5盒上对此进行了测试,并且构建良好),则生成的RPM将位于:

/usr/src/redhat/RPMS/arch

其中,“ arch”是x86_64还是i386,具体取决于您的系统。您可以yum localinstall --nogpgcheck从那里打包。


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.