LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-16-2010, 04:12 PM   #1
XXLRay
Member
 
Registered: May 2010
Posts: 120

Rep: Reputation: 16
[Ubuntu] apt libxml-sax-perl "unable to execute installed post-installation script"


I had a problem on ubuntu when running "sudo apt-get dist-upgrade" and wanted to report how I solved it. Hopefully this helps anybody with similar problems.

I always got the error message:
Code:
Setting up libxml-sax-perl (0.96+dfsg-2) ...
dpkg (subprocess): unable to execute installed post-installation script: Exec format error
dpkg: error processing libxml-sax-perl (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 libxml-sax-perl
E: Sub-process /usr/bin/dpkg returned an error code (1)
The problem is in libxml-sax-perl.postinst which does not seem to be executable.

I did not install any perl packages manually by cpan and found the solution in http://ubuntuforums.org/archive/inde...t-1342009.html where it was only one part of a bigger problem.

I created a backup file (always a good idea) of my libxml-sax-perl.postinst:
Code:
sudo cp /var/lib/dpkg/info/libxml-sax-perl.postinst /var/lib/dpkg/info/libxml-sax-perl.postinst.bak0
I deleted the old file:
Code:
sudo rm /var/lib/dpkg/info/libxml-sax-perl.postinst
Created a new file:
Code:
sudo vi /var/lib/dpkg/info/libxml-sax-perl.postinst
With the following content (copied from the link mentioned above):
Code:
#!/bin/sh 
## ---------------------------------------------------------------------- 
## debian/postinst : postinstallation script for libxml-sax-perl 
## ---------------------------------------------------------------------- 

## ----------------------------------------------------------------------
set -e 

## ----------------------------------------------------------------------
if [ "$1" = configure ] 
then 
[ -d /etc/perl/XML/SAX ] || mkdir --parents /etc/perl/XML/SAX 
if which ucfr >/dev/null 2>&1 
then 
ucfr libxml-sax-perl /etc/perl/XML/SAX/ParserDetails.ini 
fi 

if [ -n "$2" ] && dpkg --compare-versions "$2" le 0.16-0.1
then 
echo "Migrating the Perl SAX parser information directory."
# first, move /etc/perl/XML/SAX/ParserDetails.d/ under 
# /var/lib/libxml-sax-perl 
for i in /etc/perl/XML/SAX/ParserDetails.d/* 
do 
# the directory should never be missing or empty, but the [ ! -e ]
# construct handles an unexpanded glob just in case
[ ! -e "$i" ] || \
mv "$i" "/var/lib/libxml-sax-perl/ParserDetails.d/50-$(basename $i)"
done
[ ! -d /etc/perl/XML/SAX/ParserDetails.d ] || \
rmdir --ignore-fail-on-non-empty /etc/perl/XML/SAX/ParserDetails.d

# now downgrade XML::SAX::PurePerl priority by removing it first
update-perl-sax-parsers --remove XML::SAX::PurePerl
fi

update-perl-sax-parsers --add XML::SAX::PurePerl --priority 10
update-perl-sax-parsers --update
fi

## ----------------------------------------------------------------------
## automatically generated debhelper commands


exit 0

## ----------------------------------------------------------------------
Made the file executable:
Code:
sudo chmod +x /var/lib/dpkg/info/libxml-sax-perl.postinst
And upgraded again:
Code:
sudo apt-get dist-upgrade -fReading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? Y
Setting up libxml-sax-perl (0.96+dfsg-2) ...
update-perl-sax-parsers: Registering Perl SAX parser XML::SAX::PurePerl with priority 10...
update-perl-sax-parsers: Updating overall Perl SAX parser modules info file...

Creating config file /etc/perl/XML/SAX/ParserDetails.ini with new version
 
Old 07-17-2010, 09:20 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,647

Rep: Reputation: 524Reputation: 524Reputation: 524Reputation: 524Reputation: 524Reputation: 524
thanks for sharing. taking thread off ZRT
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to execute "reboot" in cgi script jcaga Fedora 4 05-10-2012 08:45 AM
"Unable to find medium with live File System" error in Ubuntu Installation. subashk80 Linux - Newbie 2 12-01-2009 11:49 PM
Getting error "sudo: unable to execute ./setup: Success" d_girish_d Linux - Software 3 07-20-2009 11:33 PM
Post Ubuntu Installation Error "No serving hosts found" Fouad Riaz Bajwa Linux - Laptop and Netbook 1 12-28-2006 08:29 PM
Compiling KDE 3.2.0 - "Can't open perl script "/dcopidlng/kalyptus" linuxgamer09483 Linux - Software 3 04-09-2004 08:25 PM


All times are GMT -5. The time now is 02:00 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration