Package in poor state interferes with apt operations



For some reason, I have Haskell installed on my machine. I'm pretty new to Linux and Debian - I've been running it for about 6 mo now without too much trouble. Now every time I try to use apt or aptitude, I get error messages. For example:

legner1:~# apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
You might want to run ‘apt-get -f install’ to correct these.
The following packages have unmet dependencies.
libc6-i686: PreDepends: libc6 (= 2.3.6-7) but 2.3.6-15 is installed
mysql-client-5.0: Depends: libmysqlclient15off (>= 5.0.22-3) but it is not installed
Depends: libmysqlclient15off (>= 5.0.19-1) but it is not installed
mysql-server-5.0: Depends: libmysqlclient15off (>= 5.0.19-1) but it is not installed
php5-mysql: Depends: libmysqlclient15off (>= 5.0.19-1) but it is not installed
Depends: php5-common (= 5.1.4-0.1) but 5.1.2-1 is installed
E: Unmet dependencies. Try using -f.
legner1:~#

So I tried their first recommendation:

legner1:~# apt-get -f install
Reading package lists... Done
Building dependency tree... Done
Correcting dependencies...Done
The following extra packages will be installed:
libapache2-mod-php5 libc6-i686 libdbd-mysql-perl libghc6-c2hs-dev libmysqlclient15off
php5-common php5-gd python-mysqldb
Suggested packages:
php-pear c2hs c2hs-doc python-egenix-mxdatetime
The following packages will be REMOVED
libmysqlclient15 python2.3-mysqldb
The following NEW packages will be installed
libmysqlclient15off
The following packages will be upgraded:
libapache2-mod-php5 libc6-i686 libdbd-mysql-perl libghc6-c2hs-dev php5-common php5-gd
python-mysqldb
7 upgraded, 1 newly installed, 2 to remove and 926 not upgraded.
5 not fully installed or removed.
Need to get 0B/5257kB of archives.
After unpacking 209kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Preconfiguring packages ...
(Reading database ... 161212 files and directories currently installed.)
Preparing to replace libghc6-c2hs-dev 0.13.6-4 (using .../libghc6-c2hs-dev_0.13.6-5_i386.deb) ...
ghc-pkg: cannot find package c2hs
dpkg: warning - old pre-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
ghc-pkg: cannot find package c2hs
dpkg: error processing /var/cache/apt/archives/libghc6-c2hs-dev_0.13.6-5_i386.deb (--unpack):
subprocess new pre-removal script returned error exit status 1
Reading package info from "/usr/lib/libghc6-c2hs-dev/ghc6/c2hs.conf" ... done.
ghc-pkg: /usr/lib/c2hs-0.13.6/ghc6/import doesn't exist or isn't a directory (use --force to override)
dpkg: error while cleaning up:
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/libghc6-c2hs-dev_0.13.6-5_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
legner1:~#

I also tried the 'apt-get -f upgrade' approach, and after about 2 hours of downloading I got this:

...
Fetched 516MB in 1h45m25s (81.6kB/s)
Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 161212 files and directories currently installed.)
Preparing to replace libghc6-c2hs-dev 0.13.6-4 (using .../libghc6-c2hs-dev_0.13.6-5_i386.deb) ...
ghc-pkg: cannot find package c2hs
dpkg: warning - old pre-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
ghc-pkg: cannot find package c2hs
dpkg: error processing /var/cache/apt/archives/libghc6-c2hs-dev_0.13.6-5_i386.deb (--unpack):
subprocess new pre-removal script returned error exit status 1
Reading package info from "/usr/lib/libghc6-c2hs-dev/ghc6/c2hs.conf" ... done.
ghc-pkg: /usr/lib/c2hs-0.13.6/ghc6/import doesn't exist or isn't a directory (use --force to override)
dpkg: error while cleaning up:
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/libghc6-c2hs-dev_0.13.6-5_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
legner1:~#

It seems like this c2hs and ghc-pkg issue is causing a bottleneck. How does one go about solving such a dilemma? Can I manually get rid of Haskell & company?



--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: E: Sub-process /usr/bin/dpkg returned an error code (1)
    ... Reading state information... ... The following extra packages will be installed: ... dpkg: warning: subprocess old pre-removal script returned error exit ... sudo apt-get install asterisk ...
    (Ubuntu)
  • apt-get problems
    ... over 200 packages and installed most of them bombing out near the end. ... xrdb python-gmenu gnome-games-data ... Install these packages without verification? ... dpkg: warning - old pre-removal script returned error exit status 1 ...
    (Ubuntu)
  • Re: Strange problem with apt
    ... as I can't install or uninstall that package using apt or dpkg. ... The following extra packages will be installed: ... File * diversions* are a way of forcing dpkg not to install a file into ...
    (Ubuntu)
  • RE: upgrade error testing powermgmt-base_1.17_i386.deb
    ... Rerun your apt-get upgrade or apt-get dist-upgrade command to finish your upgrade to the latest Sarge software. ... This will install this package and therefore solve the original problem with powermgmt-base erroring out during the upgrade. ... My solution was to dump the damned Emacs packages. ... warning - old post-removal script returned error exit status 1 ...
    (Debian-User)
  • E: Sub-process /usr/bin/dpkg returned an error code (1)
    ... sudo apt-get -f install ... Reading state information... ... The following extra packages will be installed: ... dpkg: warning: subprocess old pre-removal script returned error exit ...
    (Ubuntu)