2

I am trying to set up a Ubuntu server on Raspberry Pi 2, but at the moment I am stuck with this:

sudo: unable to resolve host ubuntu

/etc/hostname says this:

ubuntu

/etc/hosts says this:

127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

I have seen solutions where one can go into recovery mode and change the password and change the hosts, but I don't think I can do that on server version on Raspberry Pi 2. Or can I?

Thanks

troylatroy
  • 1,275
  • 1
  • 11
  • 21
lapor
  • 132

1 Answers1

5

Just add next line into /etc/hosts:

127.0.1.1 ubuntu
pa4080
  • 29,831
  • 1
    I cannot. For that I would need sudo access......and I have to appologize, it worked :) – lapor Dec 07 '16 at 19:47