
我正在尝试在 Raspberry Pi 2 上设置一个 Ubuntu 服务器,但目前我遇到了以下问题:
sudo: unable to resolve host ubuntu
/etc/hostname
说:
ubuntu
/etc/hosts
说:
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
我见过可以进入恢复模式并更改密码和更改主机的解决方案,但我认为我无法在 Raspberry Pi 2 上的服务器版本上执行此操作。或者可以吗?
谢谢
答案1
只需添加下一行/etc/hosts
:
127.0.1.1 ubuntu