There are two methods to solve this situation, one which uses a system command, and another more manual method.
Select-editor command
Use the command:
select-editor
Which will give you another attempt at using the number-based system to select the default text editor.
Manual Method:
If it does not already exist, create the .selected_editor
file for the user. This should be located in the user's home directory.
The contents should depend on which editor you prefer, for simplicity I'd recommend nano
. To use nano
the file should contain the line:
SELECTED_EDITOR=/bin/nano
To use the slightly more complicated/feature-rich editor vim
, use:
SELECTED_EDITOR=/usr/bin/vim
Once you've specified your preferred editor, reload the cron
service with:
service cron reload
At which point your user's crontab -e
command should work as expected, with the chosen editor.
NOTE:This is the upstart method for restarting a service, which still works on 14.04, though using the systemd method systemctl
is recommended for 16.04
ed
- see Crontab error “No crontab for root”