Package: vim
Version: 2:8.2.2434-3
Severity: important

Hi!

This one was kind of fun ...  upgrading an up to date buster machine to
bullseye, I hit the conffile prompt I normally expect to see for vim:

  Setting up vim-common (2:8.2.2434-3) ...

  Configuration file '/etc/vim/vimrc'
   ==> Modified (by you or by a script) since installation.
   ...


So I do what I always do, and reach for vimdiff to merge the new changes
in vimrc ... only this time, it tells me:

  # vimdiff /etc/vim/vimrc /etc/vim/vimrc.dpkg-new
  -bash: vimdiff: command not found

and vim's not there either!

  # vim
  -bash: vim: command not found

Which of course it is.  But it's a symlink through /etc/alternatives,
and a quick look shows they're now (almost) all dangling ...


What I *think* has happened is that the upgrade ordering has vim-common
being configured after all of the other vim packages have been unpacked,
but before any of them have been configured.  And with vim-gtk becoming
a dummy package with vim-gtk3 taking over from it, there's a window in
there where the alternatives have all fallen apart because they weren't
changed before /usr/bin/vim-gtk vanished, and that doesn't start to get
fixed until the rest of the vim* packages are configured again too.

As later we see:

  Setting up nano (5.4-2) ...
  Installing new version of config file /etc/nanorc ...
  update-alternatives: warning: alternative /usr/bin/vim.gtk (part of link 
group editor) doesn't exist; removing from list of alternatives
  update-alternatives: warning: /etc/alternatives/editor is dangling; it will 
be updated with best choice
  update-alternatives: using /bin/nano to provide /usr/bin/editor (editor) in 
auto mode

  ...

  Setting up vim (2:8.2.2434-3) ...
  update-alternatives: warning: alternative /usr/bin/vim.gtk (part of link 
group vim) doesn't exist; removing from list of alternatives
  update-alternatives: warning: /etc/alternatives/vim is dangling; it will be 
updated with best choice
  update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) 
in auto mode
  update-alternatives: warning: alternative /usr/bin/vim.gtk (part of link 
group vimdiff) doesn't exist; removing from list of alternatives
  update-alternatives: warning: /etc/alternatives/vimdiff is dangling; it will 
be updated with best choice
  update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff 
(vimdiff) in auto mode
  update-alternatives: warning: alternative /usr/bin/vim.gtk (part of link 
group rvim) doesn't exist; removing from list of alternatives
  update-alternatives: warning: /etc/alternatives/rvim is dangling; it will be 
updated with best choice
  update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) 
in auto mode
  update-alternatives: warning: alternative /usr/bin/vim.gtk (part of link 
group rview) doesn't exist; removing from list of alternatives
  update-alternatives: warning: /etc/alternatives/rview is dangling; it will be 
updated with best choice
  update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview 
(rview) in auto mode
  update-alternatives: warning: alternative /usr/bin/vim.gtk (part of link 
group vi) doesn't exist; removing from list of alternatives
  update-alternatives: warning: /etc/alternatives/vi is dangling; it will be 
updated with best choice
  update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in 
auto mode
  update-alternatives: warning: alternative /usr/bin/vim.gtk (part of link 
group view) doesn't exist; removing from list of alternatives
  update-alternatives: warning: /etc/alternatives/view is dangling; it will be 
updated with best choice
  update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) 
in auto mode
  update-alternatives: warning: alternative /usr/bin/vim.gtk (part of link 
group ex) doesn't exist; removing from list of alternatives
  update-alternatives: warning: /etc/alternatives/ex is dangling; it will be 
updated with best choice
  update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in 
auto mode

  ...

  Setting up vim-gtk3 (2:8.2.2434-3) ...
  update-alternatives: using /usr/bin/vim.gtk3 to provide /usr/bin/vim (vim) in 
auto mode
  update-alternatives: using /usr/bin/vim.gtk3 to provide /usr/bin/vimdiff 
(vimdiff) in auto mode
  update-alternatives: using /usr/bin/vim.gtk3 to provide /usr/bin/rvim (rvim) 
in auto mode
  update-alternatives: using /usr/bin/vim.gtk3 to provide /usr/bin/rview 
(rview) in auto mode
  update-alternatives: using /usr/bin/vim.gtk3 to provide /usr/bin/vi (vi) in 
auto mode
  update-alternatives: using /usr/bin/vim.gtk3 to provide /usr/bin/view (view) 
in auto mode
  update-alternatives: using /usr/bin/vim.gtk3 to provide /usr/bin/ex (ex) in 
auto mode
  update-alternatives: using /usr/bin/vim.gtk3 to provide /usr/bin/editor 
(editor) in auto mode
  update-alternatives: warning: alternative /usr/bin/vim.gtk (part of link 
group gvim) doesn't exist; removing from list of alternatives
  update-alternatives: warning: /etc/alternatives/gvim is dangling; it will be 
updated with best choice
  update-alternatives: using /usr/bin/vim.gtk3 to provide /usr/bin/gvim (gvim) 
in auto mode
  update-alternatives: warning: alternative /usr/bin/vim.gtk (part of link 
group gview) doesn't exist; removing from list of alternatives
  update-alternatives: warning: /etc/alternatives/gview is dangling; it will be 
updated with best choice
  update-alternatives: using /usr/bin/vim.gtk3 to provide /usr/bin/gview 
(gview) in auto mode
  update-alternatives: warning: alternative /usr/bin/vim.gtk (part of link 
group rgview) doesn't exist; removing from list of alternatives
  update-alternatives: warning: /etc/alternatives/rgview is dangling; it will 
be updated with best choice
  update-alternatives: using /usr/bin/vim.gtk3 to provide /usr/bin/rgview 
(rgview) in auto mode
  update-alternatives: warning: alternative /usr/bin/vim.gtk (part of link 
group rgvim) doesn't exist; removing from list of alternatives
  update-alternatives: warning: /etc/alternatives/rgvim is dangling; it will be 
updated with best choice
  update-alternatives: using /usr/bin/vim.gtk3 to provide /usr/bin/rgvim 
(rgvim) in auto mode
  update-alternatives: warning: alternative /usr/bin/vim.gtk (part of link 
group evim) doesn't exist; removing from list of alternatives
  update-alternatives: warning: /etc/alternatives/evim is dangling; it will be 
updated with best choice
  update-alternatives: using /usr/bin/vim.gtk3 to provide /usr/bin/evim (evim) 
in auto mode
  update-alternatives: warning: alternative /usr/bin/vim.gtk (part of link 
group eview) doesn't exist; removing from list of alternatives
  update-alternatives: warning: /etc/alternatives/eview is dangling; it will be 
updated with best choice
  update-alternatives: using /usr/bin/vim.gtk3 to provide /usr/bin/eview 
(eview) in auto mode
  update-alternatives: warning: alternative /usr/bin/vim.gtk (part of link 
group gvimdiff) doesn't exist; removing from list of alternatives
  update-alternatives: warning: /etc/alternatives/gvimdiff is dangling; it will 
be updated with best choice
  update-alternatives: using /usr/bin/vim.gtk3 to provide /usr/bin/gvimdiff 
(gvimdiff) in auto mode
  Setting up vim-gtk (2:8.2.2434-3) ...


The workaround of course is easy, just bypass the alternative link and
invoke one of the copies of vim that does exist directly - but if
vim-gtk really needs to be renamed to vim-gtk3, then the dummy vim-gtk
probably needs to fix the alternative before it removes the binary that
it might have been pointing to, in preinst, rather than leaving the
other packages to stumble through a mess that needs cleaning up.

There might be something more to it than that - but after digging though
the logs you might need to reproduce this, I *think* it actually is as
simple as the vim-gtk binary vanishing without first explicitly telling
update-alternatives the package is removing it, not replacing it ...


This is the set I have after the upgrade:

$ dpkg -l | grep vim
ii  vim                            2:8.2.2434-3
ii  vim-common                     2:8.2.2434-3
ii  vim-gtk                        2:8.2.2434-3
ii  vim-gtk3                       2:8.2.2434-3
ii  vim-gui-common                 2:8.2.2434-3
ii  vim-runtime                    2:8.2.2434-3
ii  vim-scripts                    20210124.1
ii  vim-tiny                       2:8.2.2434-3


  Cheers,
  Ron

Reply via email to