In this case, when update-alternatives does not work, try select-editor

You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to vim in Ubuntu.

   sudo crontab -e uses wrong vi version

Status in vim package in Ubuntu:

Bug description:
  Binary package hint: vim

  When editing sudo's crontab using 'sudo crontab -e' ubuntu does not
  use vim which is set as the default $EDITOR

  What was tried:
  /home/<user>/.bashrc has export EDITOR=/usr/bin/vim

  This works when I do crontab -e but not when sudo crontab -e

  1. Removed EDITOR environment variable from /home/<user>/.bashrc
  2. And tried
  sudo update-alternatives --config editor

  There are 5 alternatives which provide `editor'.

    Selection    Alternative
            1    /usr/bin/vim.tiny
            2    /bin/ed
            3    /bin/nano
            4    /usr/bin/vim.basic
  *+        5    /usr/bin/vim.gnome

  Again, this works when I do crontab -e but not when sudo crontab -e. I
  tried 1, 4 and 5. No dice.

  sudo EDITOR=vim crontab -e works. But why should I prefix the command with 
the environment variable everytime I run it. It should pick the editor as set 
in Method-1 and Method-2.

  What is expected to happen: 'sudo crontab -e' should open the crontab
  using the default system $EDITOR without much fuss.

  More info:

To manage notifications about this bug go to:

Mailing list:
Post to     :
Unsubscribe :
More help   :

Reply via email to