Debian – How to Get Rid of ‘nano not found’ Warnings Without Installing Nano

debiannanovim

Installed Debian Stretch (9.3). Installed Vim and removed Nano. Vim is selected as the default editor.

Every time I run crontab -e, I get these warnings:

root@franklin:~# crontab -e
no crontab for root - using an empty one
/usr/bin/sensible-editor: 25: /usr/bin/sensible-editor: /bin/nano: not found
/usr/bin/sensible-editor: 28: /usr/bin/sensible-editor: nano: not found
/usr/bin/sensible-editor: 31: /usr/bin/sensible-editor: nano-tiny: not found
No modification made

I've tried reconfiguring the sensible-utils package, but it gives no input (indicating success with whatever it's doing), but the warnings still appear.

root@franklin:~# dpkg-reconfigure sensible-utils
root@franklin:~# 

Although these warnings don't prevent me from doing anything, I find them quite annoying. How can I get rid of them?

Best Answer

I found my own answer and so I'm posting it here, in case it helps someone else.

In the root user's home directory, /root, there was a file alled .selected_editor, which still retained this content:

# Generated by /usr/bin/select-editor
SELECTED_EDITOR="/bin/nano"

The content suggests that the command select-editor is used to select a new editor, but at any rate, I removed the file (being in a bad mood and feeling the urge to obliterate something) and was then given the option of selecting the editor again when running crontab -e, at which point I selected vim.basic, and all was fine after that. The new content of the file reflects that selection now:

# Generated by /usr/bin/select-editor
SELECTED_EDITOR="/usr/bin/vim.basic"
Related Question