When I enter sudo su
, I get following error message:
pi@Mapi ~ $ sudo su
sudo: unable to resolve host Mapi
So in the /etc/hosts/
and in the /etc/hostname
the hostname Mapi is exact the thame (I also check that there is no space)
pi@Mapi ~ $ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.1.1 Mapi
pi@Mapi ~ $ cat /etc/hostname
Mapi
there are no spaces:
nano
-sudo nano /etc/hostname
;sudo nano /etc/hosts
- and if there are some green or red colored spaces just remove them. If you have edited these files with a not appropriate text editor, it can be a cause of this problem. If this is true, If I were you I would rewrite the content of these files entirely innano
.