oes 无法重启

既然你已验证 sudo reboot -f 有效,我们直接让 reboot 命令永久指向强制重启,完全绕过 systemd 关机流程。

1.创建别名配置文件
echo “alias reboot=’sudo systemctl –force reboot'” | sudo tee /etc/profile.d/force-reboot.sh

2.立即生效(当前终端测试)
source /etc/profile.d/force-reboot.sh

3.测试重启 reboot

系统应该立即重启,不会再卡住。

如果想恢复默认重启行为

删除配置文件即可:sudo rm /etc/profile.d/force-reboot.sh

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注