I changed the hostname from default name, set during installation to something short and nice, but didn't change it in /etc/hosts file. /etc/hostname is changed after restart but sudo is not working.
I tried to search for answers on internet. Everybody is suggesting to edit
/etc/hosts file and replace:
127.0.1.1 <previous name>
to:
127.0.1.1 <new name>
but I cannot change this file either by using:
sudo gedit /etc/hosts
It gives an error:
sudo:unable to resolve host <new-name>