大多数说 /etc/hosts 没有配置 hostname 的解析
/etc/hosts
127.0.0.1 hostname
但是没有效果。最终确认是 systemd 的bug导致的,执行 systemctl restart systemd-logind 重启 systemd-logind 可以解决
systemctl restart systemd-logind
systemd-logind
参考: