sudo: unable to resolve host

At a fresh ubuntu install I faced the error:

ubuntu@(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

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.