4

When I try to do an upgrade or install something, apt(-get or aptitude) throw an error, saying that perl can't find XML/SAX/Debian.pm while trying to configure libxml-libxml-perl. Here is the full error message :

configuring libxml-libxml-perl (2.0108+dfsg-1ubuntu0.1) ...
Can't locate XML/SAX/Debian.pm in @INC (you may need to install the XML::SAX::Debian module) (@INC contains: /usr/local/lib/perl5/site_perl/5.20.1/i686-linux-5.20.0-thread-multi-ld /usr/local/lib/perl5/site_perl/5.20.1 /usr/local/lib/perl5/5.20.1/i686-linux-5.20.0-thread-multi-ld /usr/local/lib/perl5/5.20.1 .) at /usr/bin/update-perl-sax-parsers line 19.
BEGIN failed--compilation aborted at /usr/bin/update-perl-sax-parsers line 19.
dpkg: error processing libxml-libxml-perl (--configure) :
 sub-process script post-installation installed returned an error code 2
Errors have been encountered during execution :
 libxml-libxml-perl
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've tried to remove (and purge) libxml-libxml-perl, it didn't work.

Then I've found (in debian package) and copy Debian.pm to /usr/local/lib/perl5/site_perl/5.20.1/XML/SAX/.

It fixed the error but an other one appeared :

Configuring libxml-libxml-perl (2.0108+dfsg-1ubuntu0.1) ...
update-perl-sax-parsers: Non-vendor version of XML::SAX is installed.
update-perl-sax-parsers: Automatic registration of SAX parsers might not work.
update-perl-sax-parsers: Registering Perl SAX parser XML::LibXML::SAX::Parser with priority 50...
Can't locate XML/LibXML/SAX/Parser.pm in @INC (you may need to install the XML::LibXML::SAX::Parser module) (@INC contains: /usr/local/lib/perl5/site_perl/5.20.1/i686-linux-5.20.0-thread-multi-ld /usr/local/lib/perl5/site_perl/5.20.1 /usr/local/lib/perl5/5.20.1/i686-linux-5.20.0-thread-multi-ld /usr/local/lib/perl5/5.20.1 .) at /usr/local/lib/perl5/site_perl/5.20.1/XML/SAX.pm line 147.
dpkg: error processing package libxml-libxml-perl (--configure) :
 sub-process script post-installation installed returned error code 2
configuring de libgles1-mesa:i386 (10.1.3-0ubuntu0.4) ...
configuring de libshine3:i386 (3.1.0-2) ...
configuring de libva-drm1:i386 (1.4.0~trusty) ...
configuring de libvncclient0:i386 (0.9.9+dfsg-6~ubuntu14.04.1~ppa1) ...
Processing triggers (« triggers ») for libc-bin (2.19-0ubuntu6.6) ...
Errors have been encountered during execution :
 libxml-libxml-perl
E: Sub-process /usr/bin/dpkg returned an error code (1)

I also tried dpkg-reconfigure but:

$ sudo dpkg-reconfigure libxml-libxml-perl
/usr/sbin/dpkg-reconfigure: libxml-libxml-perl is broken or not fully installed

Is there a way to fix this ?

Thanks for your answers.

P.S. : some message in the error message were in french and I have translated them They might not be exactly the same as the english error message.

EDIT:

sudo dpkg-reconfigure libxml-libxml-perl give me this : /usr/sbin/dpkg-reconfigure: libxml-libxml-perl is broken or not fully installed.

and

sudo apt-get install --reinstall libxml-libxml-perl gives :

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 7 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
E: Internal Error, No file name for libxml-libxml-perl:i386
4
  • Does sudo dpkg-reconfigure libxml-libxml-perl help? Also, you can get errpr messages in English by running the command with LC_ALL=C. For example: LC_ALL=C sudo apt-get install gedit.
    – terdon
    May 6, 2015 at 17:14
  • sudo dpkg-reconfigure libxml-libxml-perl give me this : /usr/sbin/dpkg-reconfigure: libxml-libxml-perl is broken or not fully installed
    – nefas
    May 6, 2015 at 20:22
  • 1
    Hmm. OK. I'm not sure where this is needed but will it let you reinstall it? Try sudo apt-get install --reinstall libxml-libxml-perl. Also, please don't add extra information in comments. When someone asks you for more info, edit your question and include it there. Comments can be deleted without warning and are much harder to read. Once you have edited, you can leave a comment telling the commenter that you have done so (ping them by name: @terdon).
    – terdon
    May 6, 2015 at 22:07
  • @terdon I've added the result of apt-get install --reinstall ....
    – nefas
    May 6, 2015 at 22:50

1 Answer 1

1

I realize this is a year old, but didn't see it "solved" or a solution in it. Also, this regression seems to keep happening with system upgrades, its been around for over a decade now. You can install (or re-install) the XML::SAX module by running

sudo cpanp -i XML::SAX

When it completes you should be able to reinstall perl-xml-libxml without errors with

sudo apt-get install - reinstall perl-xml-libxml 

.

1
  • 1
    Or sudo cpan -i XML::SAX, etc.
    – Andrew
    May 19, 2018 at 20:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.