LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-11-2009, 03:03 PM   #1
AncientPC
LQ Newbie
 
Registered: Apr 2007
Posts: 25

Rep: Reputation: 15
dpkg can't remove a package, dependency problems


When installing a package (hugs) through apt-get my laptop had a kernel panic and I had to do a hard reset. Upon starting up, I ran fsck all the partitions (jfs) and rebooted into Ubuntu.

However hugs was unconfigured and can't be installed / removed. I tried an apt-get purge and dpkg --configure -a / dpkg --remove -f hugs but the error message in all cases is:
Code:
root@core:/var/lib/aptitude# dpkg --remove hugs
(Reading database ... 161721 files and directories currently installed.)
Removing hugs ...
dpkg (subprocess): unable to execute pre-removal script: Exec format error
dpkg: error processing hugs (--remove):
 subprocess pre-removal script returned error exit status 2
dpkg (subprocess): unable to execute post-installation script: Exec format error
dpkg: error while cleaning up:
 subprocess post-installation script returned error exit status 2
Errors were encountered while processing:
 hugs
How do I get around the pre-removal script and force dpkg to remove hugs?
 
Old 03-11-2009, 03:18 PM   #2
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,228
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
Did you try forcing a reinstall over top of the package ?

apt-get -f install
or
apt-get -f install hugs

other options are listed here:
http://www.linux.com/feature/48910

If you get it to complete the installation you should then be able to remove it.
 
Old 03-11-2009, 05:45 PM   #3
AncientPC
LQ Newbie
 
Registered: Apr 2007
Posts: 25

Original Poster
Rep: Reputation: 15
Well I'm having trouble installing/removing it either way, but forcing the install doesn't work. One of the dependency libraries was corrupt so I cleared all the cached packages and reran the command. Now the error is "dpkg: unable to execute post-install script: Exec format error"

Code:
root@core:~# aptitude install -f hugs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Reading extended state information      
Initializing package states... Done
The following partially installed packages will be configured:
  hugs 
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Writing extended state information... Done
Setting up hugs (98.200609.21-5) ...
dpkg (subprocess): unable to execute post-installation script: Exec format error
dpkg: error processing hugs (--configure):
 subprocess post-installation script returned error exit status 2
Errors were encountered while processing:
 hugs
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Reading package lists... Done             
Building dependency tree       
Reading state information... Done
Reading extended state information      
Initializing package states... Done
 
Old 03-11-2009, 07:32 PM   #4
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,228
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
Did you look at the link I provided ? it has other options as well for working past these issues..



You should have posted this thread in the Debian forum, it might have got more exposure that way to some of the more advance Debian users, who might not notice the post here.. just for future reference.
 
Old 03-12-2009, 12:40 AM   #5
AncientPC
LQ Newbie
 
Registered: Apr 2007
Posts: 25

Original Poster
Rep: Reputation: 15
Yes, the link was very helpful and informative. However despite trying all the suggestions I still cannot install / remove the hugs package. It doesn't help that there are no other versions to force a downgrade (but even then the remove script would probably crap out).
 
Old 05-14-2010, 03:45 PM   #6
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: san antonio, texas
Distribution: Fedora 64 bit RAID0 + LUKS, CentOS (server), Backtrack, Gentoo Hardened
Posts: 1,441

Rep: Reputation: 80
I'm having the same problem with 2 different package. I'd like to know how to fix that post remove debian script. I get exit status 2, but I don't see anywhere in the script where it returns an value of 2.
 
Old 05-14-2010, 03:45 PM   #7
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: san antonio, texas
Distribution: Fedora 64 bit RAID0 + LUKS, CentOS (server), Backtrack, Gentoo Hardened
Posts: 1,441

Rep: Reputation: 80
#!/bin/sh
set -e
# Automatically added by dh_installtex
##
## postrm-tex
##
## postrm snippets for registering hyphenation patterns, font maps, and formats
##
## Authors:
## Florent Rougon <f.rougon@free.fr>
## Norbert Preining <preining@logic.at>
##
#

dhit_call_update_texmf_config ()
{
if which update-texmf-config >/dev/null; then
update-texmf-config $*
else
echo "update-texmf-config not present: is tex-common installed?" >&3
fi
}

dhit_check_run_without_errors ()
{
silent=0
if [ "$1" = "-silent" ] ; then
silent=1
shift
fi
if which "$1" >/dev/null; then
tempfile=$(mktemp -p /tmp checkrun.XXXXXXXX)
if [ $silent = 0 ] ; then
printf "Running '$*'.\nThis may take some time..."
fi
set +e
if "$@" > $tempfile 2>&1 ; then
rm -f $tempfile
[ $silent = 0 ] && echo " done."
else
echo
echo "$* failed. Output has been stored in"
echo "$tempfile"
echo "If tex-common is not configured you can ignore this error" \
"message!"
echo "Otherwise, please include this file if you report a bug."
echo
fi
set -e
fi

return 0
}


case "$1" in
remove|disappear)
dhit_check_run_without_errors -silent update-updmap --quiet
dhit_check_run_without_errors -silent update-language
dhit_check_run_without_errors -silent update-fmtutil
for i in lsrfull ; do
if [ "$i" = lsr ] ; then
dhit_call_update_texmf_config lsr
fi
if [ "$i" = lsrfull ] ; then
dhit_call_update_texmf_config lsrfull
fi
if [ "$i" = map ] ; then
dhit_call_update_texmf_config map
fi
if [ "$i" = allformats ] ; then
for fmt in ; do
rm -f /var/lib/texmf/web2c/$fmt.*
done
fi
if [ "$i" = format ] ; then
for fmt in ; do
rm -f /var/lib/texmf/web2c/$fmt.*
done
fi
if [ "$i" = hyphen ] ; then
dhit_call_update_texmf_config hyphen
fi
done
;;

purge|upgrade|failed-upgrade|abort-upgrade|abort-install)
;;

*)
echo "postrm called with unknown argument '$1'" >&2
exit 1
;;
esac

#
 
  


Reply

Tags
apt-get, aptitude, deb, dependencies, dpkg, package


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
dpkg dependency problems recif Debian 2 08-05-2008 06:28 AM
dpkg dependency issue tdemers Linux - Software 2 02-10-2007 11:54 PM
Confused on how to remove a deb package with dpkg dr_zayus69 Debian 5 06-04-2006 02:02 PM
apt-get dependency problems with alternative package Frits of waterplant Debian 3 06-01-2005 04:45 PM
dpkg dependency problems gandhi Debian 3 03-19-2005 02:50 PM


All times are GMT -5. The time now is 11:18 AM.

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