[Bug 372588] Re: sudo crontab -e uses wrong vi version
Lucas Sandery
372588 at bugs.launchpad.net
Thu Apr 12 03:16:01 UTC 2018
In this case, when update-alternatives does not work, try select-editor
instead.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to vim in Ubuntu.
https://bugs.launchpad.net/bugs/372588
Title:
sudo crontab -e uses wrong vi version
Status in vim package in Ubuntu:
Invalid
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:
----------------------
Method-1:
/home/<user>/.bashrc has export EDITOR=/usr/bin/vim
This works when I do crontab -e but not when sudo crontab -e
Method-2:
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.
Method-3:
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: http://ubuntuforums.org/showthread.php?t=1075667
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/vim/+bug/372588/+subscriptions
More information about the foundations-bugs
mailing list