繁体   English   中英

如何在Ubuntu上安装XML :: LibXML

[英]How can I install XML::LibXML on Ubuntu

这是安装的标准输出:

$sudo cpanm XML::LibXML
--> Working on XML::LibXML
Fetching http://www.cpan.org/authors/id/S/SH/SHLOMIF/XML-LibXML-2.0014.tar.gz ... OK
Configuring XML-LibXML-2.0014 ... N/A
! Configure failed for XML-LibXML-2.0014. See /home/kahmed/.cpanm/build.log for details.

细节:

Unpacking XML-LibXML-2.0014.tar.gz
Entering XML-LibXML-2.0014
Checking configure dependencies from META.yml
Checking if you have ExtUtils::MakeMaker 0 ... Yes (6.55_02)
Configuring XML-LibXML-2.0014
Running Makefile.PL
enable native perl UTF8
running xml2-config...ok (2.9.0)
Checking for ability to link against xml2...no
Checking for ability to link against libxml2...libxml2, zlib, and/or the Math library (-lm) have not been found.
Try setting LIBS and INC values on the command line
Or get libxml2 from
  http://xmlsoft.org/
If you install via RPMs, make sure you also install the -devel
RPMs, as this is where the headers (.h files) are.

Also, you may try to run perl Makefile.PL with the DEBUG=1 parameter
to see the exact reason why the detection of libxml2 installation
failed or why Makefile.PL was not able to compile a test program.
-> N/A
-> FAIL Configure failed for XML-LibXML-2.0014. See /home/kahmed/.cpanm/build.log for details.

我尝试手动安装libxml2,但仍然遇到同样的问题。

另外,我检查了libxml2-dev:

 sudo apt-get install libxml2-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libxml2-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 78 not upgraded.

这是系统信息:

 lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 11.04
Release:    11.04
Codename:   natty

uname -a Linux autobot 2.6.38-8-server#42-Ubuntu SMP Mon Apr 11 03:49:04 UTC 2011 x86_64 x86_64 x86_64 GNU / Linux

我认为相关的是:

Checking for ability to link against libxml2...libxml2, zlib, and/or the Math library (-lm) have not been found.

所以,你已经覆盖了libxml。 你安装了适当的zlib包吗? 尝试:

sudo apt-get install zlib1g-dev

然后再次尝试安装XML :: LibXML。

你为什么要为此使用CPAN呢? 如果您具有标准操作系统安装程序提供的本机程序包,则通常非常不明智地安装CPAN程序包。

Ubuntu的提供了很多的Perl包本身,具有以下命名约定:包名称总是开头lib ,像然后Perl包名称XML::LibXML被转换为小写和::更换冲- XML::LibXML => xml-libxml ),最后添加-perl后缀。 换句话说, XML::LibXML本机包名称是libxml-libxml-perl

因此,在您的情况下,您只需运行此命令,它将自动提取所有必需的依赖项:

sudo apt-get install libxml-libxml-perl

如果您因任何原因不喜欢这个软件包,可以使用sudo apt-get remove卸载它。 如果使用CPAN,则很难可靠地卸载它。

忽略了显而易见的:

sudo apt-get install --reinstall zlibc zlib1g zlib1g-dev

然后:

sudo cpanm XML::LibXML

作品!

也许这是新版本。 我做了:

sudo apt-get install libxml2-dev

此模块构建并成功安装后

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM