How can I solve this error I get when I commit changes on an SVN repository from the Ubuntu terminal?

Solution 1:

This is usually caused by running sudo nano [file]. This runs the nano process as root, but leaves $HOME set to the regular user's home directory, so if nano creates any files (including the .nano_history file), it will be owned by root and placed in your home directory.

You can verify this by running:

ls -l /home/ssylee/.nano_history

If ls reports that the file is owned by root, then you can be reasonably sure this was the cause. If it is, then the situation can be repaired by running:

sudo chown $USER: ~/.nano_history

or to spell out that command:

sudo chown ssylee: /home/ssylee/.nano_history

A better habit to get into is to use sudoedit or sudo -e instead of sudo nano. This runs the $EDITOR program on a copy of the file being edited, and then atomically replaces the original file when the editor exits (which is very useful when editing system files).

By default, this may launch vi, but you can fix this temporarily by invoking it like so:

EDITOR=nano sudoedit [filename]

You can permanently configure $EDITOR in your .bashrc, or by placing

EDITOR=nano

in /etc/environment.

Solution 2:

The easiest is to remove the file in question. The next easiest is to make it readable with chmod/chown. The next easiest is to use a different editor.