gpt4 book ai didi

ubuntu - 无法启动 hostname.service : Unit hostname. 服务被屏蔽

转载 作者:太空宇宙 更新时间:2023-11-03 16:47:58 26 4
gpt4 key购买 nike

无法启动 hostname.service:单元 hostname.service 被屏蔽。

这发生在主机名更新之后,尝试执行 sudo 服务主机名启动。

最佳答案

在运行 service hostname restart 之前更新 /etc/hostname 文件和 /etc/hosts 文件中的主机名。

在运行 systemd 的较新系统上(例如 Ubuntu 16.04),必须使用:

sudo hostnamectl set-hostname new-host-name 。在这里,使用您的主机名编辑 new-host-name

关于ubuntu - 无法启动 hostname.service : Unit hostname. 服务被屏蔽,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48781464/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com