Diversion of /usr/bin/vim is broken

Bug #7593 reported by Mark Shuttleworth
14
Affects Status Importance Assigned to Milestone
vim (Ubuntu)
Fix Released
High
LaMont Jones

Bug Description

With vim-gnome installed I tried to install vim-python. The installation failed,
saying that it clashed with a diversion from vim-gnome of /usr/bin/vim to
/usr/bin/vim.org.

This continued to happen even after removing vim-gnome.

Typing the follow command fixed the problem:

sudo dpkg-divert --remove /usr/bin/python

Mark

Revision history for this message
Matt Zimmerman (mdz) wrote :

I don't think we want to support all of the vim variants in Debian; they have
iissues like this which make them problematic. We should pick a single vim
variant and include it in desktop or base. vim-tiny would be nice in base, but
apparently it doesn't exist anymore.

Revision history for this message
Matt Zimmerman (mdz) wrote :

I recommend that we go with plain vim as our One True VIM. No messy diversions,
simple, straightforward, works. Objections?

Revision history for this message
Mark Shuttleworth (sabdfl) wrote :

I'd rather support plain vim and vim-python. Python Everywhere is one long term
goal. An editor is a reasonable place to want to do some scripting.

Revision history for this message
Matt Zimmerman (mdz) wrote :

I would prefer that we integrate python in our vim package, rather than trying
to support this broken vim-python package. Does that work for you?

Revision history for this message
Matt Zimmerman (mdz) wrote :

Mark, what's your opinion on ditching vim-python and building python scripting
support into 'vim'? That simplifies things greatly, while preserving our goal
of python integration.

If GNOME support is desirable as well, we can also build that in.

Revision history for this message
Mark Shuttleworth (sabdfl) wrote :

Sure, if building python support into vim is easy.

Revision history for this message
Matt Zimmerman (mdz) wrote :

It should be fairly trivial. LaMont, please take care of it.

Revision history for this message
Matt Zimmerman (mdz) wrote :

LaMont, also build GNOME support into vim. Then we can get rid of vim-gnome as
well, which has the same annoying bug.

Revision history for this message
Matt Zimmerman (mdz) wrote :

*** Bug 8394 has been marked as a duplicate of this bug. ***

Revision history for this message
LaMont Jones (lamont) wrote :

Fixed in 1:6.2-532+4ubuntu2.

Revision history for this message
Markus Kolb (mkolb) wrote :

Maybe fixed in the new package but updated packages are not installable here
when vim-gnome is installed and after removing vim-gnome the package vim and
vim-common are updated but the diversion handling is still wrong. There is only
vim.org and no vim and so the alternatives don't work.
I had to do a dpkg-divert --remove /usr/bin/vim
before updating works.
This has been a known bug in Debian vim-gnome a long time ago... why you use
this old and buggy vim version from Debian as basis for Ubuntu?

Revision history for this message
Matt Zimmerman (mdz) wrote :

vim-gnome is an unsupported package, in large part because of these bugs.
Instead, we provide the same functionality in the 'vim' package and avoid the
problematic diversions.

Revision history for this message
Stuart Bishop (stub) wrote :

vim-gnome is still appearing in synaptic with an -ubuntu prefix, as does
vim-python. Both of these clash with the base vim package.

Revision history for this message
Stuart Bishop (stub) wrote :

Trying to run python commands within vim gives the error message:
E319: Sorry, the command is not available in this version

(eg. ':python from vim import *')

Revision history for this message
Mark Shuttleworth (sabdfl) wrote :

we need to replace the vim-python package with an empty package, the description
of which says that the ubuntu vim includes both gnome and python. same for
vim-gnome. and these packages should depend on vim, so that installing
vim-python brings in vim.

This way, someone who had vim-python installed will get our new shiny vim.

Revision history for this message
Matt Zimmerman (mdz) wrote :

I agree that vim-python and vim-gnome should be retired for our purposes and
replaced with transitional packages.

Unfortunately, this means that we still need to clean up the mess that was
created by the Debian versions of these packages. LaMont, can you take care of it?

Revision history for this message
Matt Zimmerman (mdz) wrote :

(In reply to comment #14)
> Trying to run python commands within vim gives the error message:
> E319: Sorry, the command is not available in this version
>
> (eg. ':python from vim import *')

Presumably you had installed vim-gnome at some point, and due to bugs in that
package, you are still running the vim provided by vim-gnome, and not the one in
the vim package. Here's the quick fix:

mizar:[~] ls -l /usr/bin/vim*
-rwxr-xr-x 1 root root 1037432 2004-08-13 02:31 /usr/bin/vim
-rwxr-xr-x 1 root root 1394296 2004-09-23 18:21 /usr/bin/vim.org
lrwxrwxrwx 1 root root 3 2004-09-23 19:01 /usr/bin/vimdiff -> vim
-rwxr-xr-x 1 root root 1600 2004-09-23 18:21 /usr/bin/vimtutor
mizar:[~] sudo dpkg-divert --remove /usr/bin/vim
Password:
Removing `diversion of /usr/bin/vim to /usr/bin/vim.org by vim-gnome'
dpkg-divert: rename involves overwriting `/usr/bin/vim' with
  different file `/usr/bin/vim.org', not allowed
zsh: exit 2 sudo dpkg-divert --remove /usr/bin/vim
mizar:[~] sudo rm /usr/bin/vim
mizar:[~] sudo dpkg-divert --remove /usr/bin/vim
Removing `diversion of /usr/bin/vim to /usr/bin/vim.org by vim-gnome'

Revision history for this message
Stuart Bishop (stub) wrote :

(In reply to comment #17)

> Presumably you had installed vim-gnome at some point, and due to bugs in that
> package, you are still running the vim provided by vim-gnome, and not the one in
> the vim package. Here's the quick fix:

Yup. The fix worked just fine. Thanks :-)

Revision history for this message
Markus Kolb (mkolb) wrote :

Ah, ok. I didn't see that vim-gnome (gvim) is already included in vim package
because there was no menu entry for gvim. Maybe there can be added a file
/usr/share/applications/gvim.desktop again...

Revision history for this message
Matt Zimmerman (mdz) wrote :

vim (1:6.3-025+1ubuntu1) warty; urgency=low

  * New version from sid (Closes: Warty#1687)
    - Fixes diversions (Closes: Warty#834)
  * Merge changes from 1:6.2-532+4ubuntu1
    - Don't build kvim*
    - Remove build-dependency on kdelibs
    - Don't build vim-ruby
    - Remove build-dependencies on ruby, ruby-dev
  * Build vim-basic with python support
  * Don't build with GNOME support, since that would bloat base
  * Add conflicts: vim (= 1:6.2-532+4ubuntu2) to vim variants
    due to moving of gvimrc
    (Closes: Warty#1717)

 -- Matt Zimmerman <email address hidden> Fri, 24 Sep 2004 13:46:42 -0700

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.