Package: dpkg
Version: 1.16.1.2
Severity: normal

I accidentally removed all symlinks in /etc/alternatives/ by using:

- cd /etc
- bzr init
- bzr add alternatives
- bzr revert alternatives

(I think bzr shouldn´t remove files on reverting the action to just
add them to the branch, but thats a different issue I want to report
upstream.)

Upon trying to restore the symlinks I searched the internet and found:

dpkg: [update-alternatives] Add option --rebuild-all to restore symlinks
http://bugs.debian.org/395556

which was fixed by documenting

       --all  Call  --config  on  all alternatives. It can be usefully com-
              bined with --skip-auto to review and configure  all  alterna-
              tives  which  are  not  configured  in automatic mode. Broken
              alternatives are also displayed.  Thus a simple  way  to  fix
              all  broken  alternatives is to call yes '' | update-alterna-
              tives --force --all.

in update-alternatives(8).

But after that command issued on the shell the alternatives links
have not been restored. To demonstrate this:

root@rx3001:/etc# mv alternatives/ alternatives-2011-12-06
root@rx3001:/etc# mkdir alternatives
root@rx3001:/etc# ls alternatives
root@rx3001:/etc# yes '' | LANG=C update-alternatives --force --all
There is 1 choice for the alternative aptitude (providing /usr/bin/aptitude).

  Selection    Path                      Priority   Status
------------------------------------------------------------
  0            /usr/bin/aptitude-curses   30        auto mode
  1            /usr/bin/aptitude-curses   30        manual mode

Press enter to keep the current choice[*], or type selection number: 
update-alter
natives: warning: forcing reinstallation of alternative (null) because link 
group
 aptitude is broken.

[…]

root@rx3001:/etc# ls alternatives
root@rx3001:/etc#


My work-around was to use the brute-force approach:

root@rx3001:~# for PAKET in $(dpkg -l | sed '1,5d' | awk '{ print $2; }') ; do 
echo "====$PAKET===="; aptitude reinstall $PAKET; done


Expected results:

Said one liner works or another one liner is noted in the manpage.

Or if no one liner possible: The hint to it in the manpage is removed.

PS: This didn´t happen on this notebook I report this bug from. It happened
on a freshly installed Debian Squeeze 6.0.3.


Thanks,
Martin


-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (120, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.1.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dpkg depends on:
ii  coreutils    8.13-3
ii  libbz2-1.0   1.0.6-1
ii  libc6        2.13-21
ii  libselinux1  2.1.0-4
ii  xz-utils     5.1.1alpha+20110809-3
ii  zlib1g       1:1.2.3.4.dfsg-3

dpkg recommends no packages.

Versions of packages dpkg suggests:
ii  apt  0.8.15.9

-- no debconf information



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to