在运行 Systemd 或者相关的命令时,你可能会遇到下面的问题:
System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down
你可能需要给 wsl 升级:
wsl --update
编辑或者创建 /etc/wsl.conf 文件:
sudo vi /etc/wsl.conf
添加以下内容:
[boot]
systemd = true
退出 Ubuntu ,然后重试:
wsl --shutdown
然后重新启动 Ubuntu ,运行:
sudo systemctl status