LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 10-01-2006, 03:49 PM   #1
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,231
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
Broken Package during upgrade - unable to fix


I was running an apt-get upgrade on my Debian sid machine and one of the packages didn't upgrade properly and is now in limbo. I am unable to re-install or uninstall this package.

any idea what I can do to fiox this ?

I've tried re-installing it, removing it, forcing the installation, forcing the removal, re-downloading the package in case it was corrupt and trying agian.. nothing has worked so far.

Code:
debian:~# apt-get install mysql-server-5.0
Reading package lists... Done
Building dependency tree... Done
Suggested packages:
  tinyca
The following packages will be upgraded:
  mysql-server-5.0
1 upgraded, 0 newly installed, 0 to remove and 120 not upgraded.
448 not fully installed or removed.
Need to get 0B/25.0MB of archives.
After unpacking 17.7MB of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 153460 files and directories currently installed.)
Preparing to replace mysql-server-5.0 5.0.24a-4 (using .../mysql-server-5.0_5.0.24a-5_i386.deb) ...
Stopping MySQL database server: mysqld/lib/lsb/init-functions: line 134: FANCYTTY: unbound variable
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: warning - old pre-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
Stopping MySQL database server: mysqld/lib/lsb/init-functions: line 134: FANCYTTY: unbound variable
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: error processing /var/cache/apt/archives/mysql-server-5.0_5.0.24a-5_i386.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
Stopping MySQL database server: mysqld/lib/lsb/init-functions: line 134: FANCYTTY: unbound variable
invoke-rc.d: initscript mysql, action "stop" failed.
Starting MySQL database server: mysqld/lib/lsb/init-functions: line 134: FANCYTTY: unbound variable
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error while cleaning up:
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/mysql-server-5.0_5.0.24a-5_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

debian:~# apt-get remove mysql-server-5.0 --purge
Reading package lists... Done
Building dependency tree... Done
The following packages will be REMOVED:
  mysql-server-5.0*
0 upgraded, 0 newly installed, 1 to remove and 120 not upgraded.
448 not fully installed or removed.
Need to get 0B of archives.
After unpacking 49.1MB disk space will be freed.
Do you want to continue [Y/n]?
dpkg: error processing mysql-server-5.0 (--purge):
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting a removal.
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct NULL not valid
Aborted
debian:~# Errors were encountered while processing:
 mysql-server-5.0


debian:~# dpkg --remove --force-remove-reinstreq mysql-server-5.0
dpkg - warning, overriding problem because --force enabled:
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting a removal.
(Reading database ... 153460 files and directories currently installed.)
Removing mysql-server-5.0 ...
Stopping MySQL database server: mysqld/lib/lsb/init-functions: line 134: FANCYTTY: unbound variable
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: error processing mysql-server-5.0 (--remove):
 subprocess pre-removal script returned error exit status 1
Stopping MySQL database server: mysqld/lib/lsb/init-functions: line 134: FANCYTTY: unbound variable
invoke-rc.d: initscript mysql, action "stop" failed.
Starting MySQL database server: mysqld/lib/lsb/init-functions: line 134: FANCYTTY: unbound variable
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error while cleaning up:
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 mysql-server-5.0


debian:~# apt-get -f install mysql-server-5.0
Reading package lists... Done
Building dependency tree... Done
Suggested packages:
  tinyca
The following packages will be upgraded:
  mysql-server-5.0
1 upgraded, 0 newly installed, 0 to remove and 120 not upgraded.
448 not fully installed or removed.
Need to get 0B/25.0MB of archives.
After unpacking 17.7MB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously deselected package mysql-server-5.0.
(Reading database ... 153460 files and directories currently installed.)
Preparing to replace mysql-server-5.0 5.0.24a-4 (using .../mysql-server-5.0_5.0.24a-5_i386.deb) ...
Stopping MySQL database server: mysqld/lib/lsb/init-functions: line 134: FANCYTTY: unbound variable
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: warning - old pre-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
Stopping MySQL database server: mysqld/lib/lsb/init-functions: line 134: FANCYTTY: unbound variable
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: error processing /var/cache/apt/archives/mysql-server-5.0_5.0.24a-5_i386.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
Stopping MySQL database server: mysqld/lib/lsb/init-functions: line 134: FANCYTTY: unbound variable
invoke-rc.d: initscript mysql, action "stop" failed.
Starting MySQL database server: mysqld/lib/lsb/init-functions: line 134: FANCYTTY: unbound variable
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error while cleaning up:
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/mysql-server-5.0_5.0.24a-5_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Really don't have a clue how to move forward from this point..

It looks like this problem may be realted to this BUG REPORT but I would think there should be a way to purge the package somehow..

I cannot complete my upgrade until I fix this..

Thanks for your assistance.

Last edited by farslayer; 10-01-2006 at 03:58 PM.
 
Old 10-01-2006, 04:12 PM   #2
Dutch Master
Senior Member
 
Registered: Dec 2005
Posts: 1,673

Rep: Reputation: 122Reputation: 122
Damn, you've got yourself in a mess. But then, you are running Unstable...
Anyway, how about "downgrading" to Etch? Then keep MySQL at Etch using pinning while upgrading to Sid. Not sure it's gonna work though...

Last edited by Dutch Master; 10-01-2006 at 04:14 PM.
 
Old 10-01-2006, 05:16 PM   #3
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid
Posts: 4,732
Blog Entries: 12

Rep: Reputation: 455Reputation: 455Reputation: 455Reputation: 455Reputation: 455
Dutch Master is going in the right direction.

Manually stop the process. Then>
Try using Synaptic, enable the Testing repo, remove the package then reinstall it using the one from testing. Synaptic may even tell you that the pcakage is broken and allow you to remove it.

Running into problems like that is one of the reason I swear by Synaptic and apt-listbugs. January will be 3 years running Debian Sid, and I only had a similiar problem once because of a package I had placed on hold.
 
Old 10-01-2006, 07:32 PM   #4
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,231
Blog Entries: 5

Original Poster
Rep: Reputation: 189Reputation: 189
Yes it is unstable as I mentioned in the original post, and has been unstable since install day over a year ago. Any breakage I've run into before was easy to work through but this time the package just refuses to move either way..

I will have to look into apt-listbugs to see what that is...

I killed the process because the stop script won't work.
Tried to remove it
that failed
Killed the process again because attempting to remove it restarted it ?? wierd..
Tried to re-install it

Still no go

Can't see pinning it to testing and downgrading when the partially installed packages refuses to move either way due to whatever is wrong with it. just curious how that would fix he issue. isn't the uninstall script part of the curently installed package ? no matter what package, stable testing or unstable I try to install it's still going to use it's own uninstall script no ?

so I tried synaptic, selected the package mysql-server-5.0 told it to remove all and hit apply
Synaptic tried to remove the package, failed and threw an error telling me to run dpkg --configure -a

I ran this command and the system finished installing the rest of the packages from my 'upgrade'

apt-cache policy mysql-server-5.0 showed the following
Code:
mysql-server-5.0:
  Installed: 5.0.24a-4
  Candidate: 5.0.24a-5
so theres been another release since last week when I attempted the upgrade I guess..

I did the following

apt-get update
apt-get upgrade

and told it to go ahead and install the 138 packages listed..

apparently whatever the issue was has been fixed as the upgrade ran without a hitch apt-cache policy now shows
Code:
mysql-server-5.0:
  Installed: 5.0.24a-5
  Candidate: 5.0.24a-5
the mysqld start and stop scripts work again, so it looks like I'm back in good shape.

Thanks for the pointers. running synaptic, even though it couldn't fix the problem, provided the dpkg command to allow me to break the deadlock. I guess my assumption on the uninstall scripts was incorrect.
 
Old 10-01-2006, 08:13 PM   #5
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid
Posts: 4,732
Blog Entries: 12

Rep: Reputation: 455Reputation: 455Reputation: 455Reputation: 455Reputation: 455
Grats on getting the problem fixed.

apt-listbugs can be a lifesaver when running unstable.
Basically it lists critical bugs before each apt installation.
 
Old 10-02-2006, 03:57 AM   #6
davcefai
Member
 
Registered: Dec 2004
Location: Malta
Distribution: Debian Sid
Posts: 764

Rep: Reputation: 32
One little caveat with apt listbugs. It often lists fixed bugs, marking then <done>. I suppose this is so that you can decide whether to take the risk or not.

You can get more info from bugs.debian.org and searching for the bug number.
 
Old 10-02-2006, 11:10 AM   #7
basileus
Member
 
Registered: Nov 2004
Location: Turku, Finland
Distribution: Debian, Ubuntu, Gentoo
Posts: 388

Rep: Reputation: 30
If you get a broken package that you are not able to uninstall do a

dpkg --purge --force-all package_name

If you do not want to remove the config files you have created then do

dpkg --remove --force-all package_name

These _will_ remove the package no matter what. It might fail if PRERM or POSTRM scripts are broken, in which case you might have to fix them. I've used this a lot to force purging of packages on my Debian Testing systems.

Last edited by basileus; 10-02-2006 at 11:12 AM.
 
  


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
Aptitude--How to fix broken package kkruecke Debian 1 08-29-2006 03:12 PM
synaptic package manager forcing me to delete a broken package mbman Linux - Software 6 04-25-2006 09:30 AM
Unable to uninstall broken package - anyone dealt successfuly with that? karel2005 Fedora - Installation 4 01-03-2005 07:33 AM
X.ORG Broken... is it possible to fix!? electronique Slackware 19 11-27-2004 05:13 PM
Manually Fix Broken Dependancies? kiteless Linux - Software 0 09-09-2003 02:33 PM


All times are GMT -5. The time now is 02:51 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