[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#48895: problems with update-alternatives



Package: dpkg
Version: 1.4.1.19
Severity: normal


OK  I can't see my way out of this.  Please advise.

I messed up with a previous xemacs21 package and forgot to put
update-alternatives --remove lines in the prerm script for the mule,
nomule, and mule-canna-wnn packages.  So anyone who had that version
installed will still have xemacs21 links to now non-existant binaries.
So I figured I'd mess with update-alternatives and see if I could
figure out how to remove these dangling alternatives correctly and I
can't seem to find a combination that won't leave me in manual update
mode.  Here's a trace of what I think should work:

+ update-alternatives --verbose --install /usr/bin/Foo32 Foo32 /usr/bin/Foo32-1-A 70
Checking available versions of Foo32, updating links in /etc/alternatives ...
(You may modify the symlinks there yourself if desired - see `man ln'.)
Updating Foo32 (/usr/bin/Foo32) to point to /usr/bin/Foo32-1-A.
+ update-alternatives --verbose --remove Foo32 /usr/bin/Foo32-1-A
Alternative for Foo32 points to /usr/bin/Foo32-1-A - which wasn't found.  Removing from list of alternatives.
/etc/alternatives/Foo32 has been changed (manually or by a script).
Switching to manual updates only.
Checking available versions of Foo32, updating links in /etc/alternatives ...
(You may modify the symlinks there yourself if desired - see `man ln'.)
Alternative /usr/bin/Foo32-1-A for Foo32 not registered, not removing.
Automatic updates of /etc/alternatives/Foo32 are disabled, leaving it alone.
To return to automatic updates use `update-alternatives --auto Foo32'.
+ update-alternatives --verbose --install /usr/bin/Foo32 Foo32 /usr/bin/x10-automate 60
Checking available versions of Foo32, updating links in /etc/alternatives ...
(You may modify the symlinks there yourself if desired - see `man ln'.)
Automatic updates of /etc/alternatives/Foo32 are disabled, leaving it alone.
To return to automatic updates use `update-alternatives --auto Foo32'.

The first update-alternatives is meant to simulate the dangling
alternative.  The second me removing it, but as you can see it
switches to manual update mode there.  The third is installing an
alternative that actually points to something real (I just randomly
picked x10-automate).

I can of course do update-alternatives --auto Foo32 in the script and
fix the problem, but this is a bad solution because it'll mess up and
real changes a person has done on their local machine.

Setting up automatic selection of Foo32.
Checking available versions of Foo32, updating links in /etc/alternatives ...
(You may modify the symlinks there yourself if desired - see `man ln'.)
Updating Foo32 (/usr/bin/Foo32) to point to /usr/bin/x10-automate.

Any ideas?  The only thing I can think of is to grep the output of the
--remove line for "Switching to manual updates only" and doing the
--auto line then and only then, but that's an ugly solution.

Thanks
Jim

-- System Information
Debian Release: potato
Architecture: i386
Kernel: Linux dres 2.2.13ac1 #1 Thu Oct 21 23:23:46 EDT 1999 i686

Versions of packages dpkg depends on:
ii  libc6                         2.1.2-8    GNU C Library: Shared libraries an
ii  libncurses4                   4.2-3.4    Shared libraries for terminal hand
ii  libstdc++2.10                 1:2.95.2-1 The GNU stdc++ library            


Reply to: