解决'System has not been booted with systemd as init system'错误
解决 'System has not been booted with systemd as init system' 错误
在运行 systemctl 命令时遇到 'System has not been booted with systemd as init system (PID 1). Can't operate.' 错误,意味着你的系统未使用 systemd 作为初始化系统启动。这可能是因为系统版本较旧或使用了其他初始化系统。
更改默认显示管理器
虽然无法直接解决此问题,但你可以尝试更改默认显示管理器,这可能有助于解决一些相关问题:
方法一:使用 update-rc.d 命令
-
禁用当前显示管理器:
sudo update-rc.d -f <current_display_manager> remove将
<current_display_manager>替换为当前使用的显示管理器名称,例如gdm3或lightdm。 -
启用目标显示管理器:
sudo update-rc.d <new_display_manager> defaults将
<new_display_manager>替换为目标显示管理器名称。 -
重启系统:
sudo reboot
方法二:手动编辑启动配置文件
-
打开
/etc/init.d/rc文件:sudo nano /etc/init.d/rc -
找到
DEFAULT_DISPLAY_MANAGER=行,将其值更改为目标显示管理器的路径,例如/usr/sbin/gdm3或/usr/sbin/lightdm。 -
重启系统:
sudo reboot
注意: 手动编辑启动配置文件需要谨慎操作。建议参考 Ubuntu 官方文档、论坛或寻求专业人士帮助获取更详细的指导和支持。
原文地址: https://www.cveoy.top/t/topic/b3rg 著作权归作者所有。请勿转载和采集!