apt-get problem --fixed :-)

Herb Richter hgr-FjoMob2a1F7QT0dZR+AlfA at public.gmane.org
Sun Dec 18 04:02:44 UTC 2005


On 17 Dec 2005, Tim Writer wrote:

> Herb Richter <hgr-FjoMob2a1F7QT0dZR+AlfA at public.gmane.org> writes:
>
> > I have a problem with one computer running knoppix(4.0)/dedian.
> >
> > While preparing to install a driver for a HP printer as per HP's
> > instructions(?) on hpinkjet.sourceforge.net,  an apt-get install ___
> > failed but went on to remove a *lot* of files including all/most of KDE.
> >
> > Now I am unable to install / remove *any* packages using either apt-get or
> > aptitude.  Both seem to get hung trying to remove "kdebluetooth" :
> >
> > ------------------------
> >
> > root ~ # aptitude
> > (Reading database ... 81870 files and directories currently installed.)
> > Removing kdebluetooth ...
> > dpkg-divert: mismatch on divert-to
> >   when removing `diversion of /usr/bin/kdesktop_lock to
> > /usr/bin/kdesktop_lock_nobt by kdebluetooth'
> >   found `diversion of /usr/bin/kdesktop_lock to
> > /usr/bin/kdesktop_lock.orig by kdelock-knoppix'
> > dpkg: error processing kdebluetooth (--remove):
> >  subprocess post-removal script returned error exit status 2
> > Errors were encountered while processing:
> >  kdebluetooth
> > E: Sub-process /usr/bin/dpkg returned an error code (1)
> > Ack!  Something bad happened while installing packages.  Trying to
> > recover:
> > Press return to continue.
> >
> > ------------------------
> >
> > ...I've tried a few things to work around this - like keep/hold
> > kdebluetooth, running dselect and renaming
> > "/var/cache/apt/archives/libbluetooth1_2.19-1_i386.deb" but nothing has
> > worked.
> >
> > ...it looks like kdebluetooth does not actually exist except in some
> > apt-get table or cache.
> >
> > What can I try now?
>
> Try to forcibly remove kdebluetooth:
>
>     # dpkg -r --force-all kdebluetooth
>
> If that succeeds, fix APT:
>
>     # apt-get install -f
>
> This may or may not install/remove a lot of package to satisfy dependencies.

Hi Tim, ...thanks for the reply;

tried dpkg -r --force-all kdebluetooth but still got:

root ~ # dpkg -r --force-all kdebluetooth
(Reading database ... 81870 files and directories currently installed.)
Removing kdebluetooth ...
dpkg-divert: mismatch on divert-to
  when removing `diversion of /usr/bin/kdesktop_lock to
/usr/bin/kdesktop_lock_nobt by kdebluetooth'
    found `diversion of /usr/bin/kdesktop_lock to
/usr/bin/kdesktop_lock.orig by kdelock-knoppix'
    dpkg: error processing kdebluetooth (--remove):
     subprocess post-removal script returned error exit status 2
     Errors were encountered while processing:
      kdebluetooth


...this did lead me to take a look for some code involving "diversion" or
"/usr/bin/kdesktop_lock_nobt" etc., which did exist in a (remaining) file:

/var/lib/dpkg/info/kdebluetooth.postrm

#! /bin/sh
# postrm script for kdebluetooth
#
[cut]

case "$1" in

purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
      # Remove diversion for kbluelock.
      # When changing this, don't forget to change preinst also.
      if [ remove = "$1" ]; then
        if [ -x /usr/bin/kdesktop_lock_nobt ]; then
          rm /usr/bin/kdesktop_lock
        fi
###        dpkg-divert --package kdebluetooth --remove --rename \
###           --divert /usr/bin/kdesktop_lock_nobt /usr/bin/kdesktop_lock
###  ...plus to remove...
        rm /usr/bin/kdesktop_lock

...when commented out as above, the
	dpkg -r --force-all kdebluetooth
worked and I can now
	aptitude install screensaver
:-)

...Thanks again,

-- 

        Herb Richter  <hgr-FjoMob2a1F7QT0dZR+AlfA at public.gmane.org>
        Toronto, Ontario
        http://PartsAndService.com
        http://PartsAndService.ca


--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list