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

前端之家收集整理的这篇文章主要介绍了在CentOS 5.X上安装libxml2 2.7.X前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
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?

确保安装了开发工具:
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

此时可能会提示您输入某些依赖项(如果是这样,只需安装相关的依赖项,然后重新运行上面的rpmbuild -ba命令).

假设你的构建成功完成(我刚刚在这里的CentOS 5盒子上进行了测试,它构建得很好),得到的RPM将在:

/usr/src/redhat/RPMS/arch

其中“arch”是x86_64或i386,具体取决于您的系统.你可以从那里yum localinstall –nogpgcheck包.

猜你在找的CentOS相关文章