sudo: unable to resolve host

At a fresh ubuntu install I faced the error:

[email protected](none):~$ sudo su –
sudo: unable to resolve host (none)

To solve this check two things:

  1. That the /etc/hostname file has only the name of the machine and nothing else
  2. That /etc/hosts has the localhost and the name of the machine
    127.0.0.1 localhost
    127.0.0.1 my-machine

 

 

Share

Leave a Reply