I really like using nano for quick and simple editing of text files on my Ubuntu systems. This means that I mostly use sudo nano but because I also run nano as a user I experience the following error:
Error reading /home/<username>/.nano_history: Permission denied Press Enter to continue starting nano.
The fix requires editing the nano configuration file /etc/nanorc and deleting /home/<username>/.nano_history.
First comment out the set historylog parameter of nanorc with this command: sudo nano /etc/nanorc
This will disable the ~/.nano_history file used for saving and reading search /replace strings.
This still leaves the .nano_history file in your user directory. Delete this file as follows:
sudo rm .nano_history