Debian系统关闭休眠模式
参考链接
https://www.cnblogs.com/hellojesson/p/18558815
1. 查看当前是否处于休眠模式
systemctl status sleep.target
可以看到处于休眠模式
2. 关闭休眠模式
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
如果没有管理员权限,可以参考:Linux下 <用户名> is not in the sudoers file_用户名不在sudoers文件中-CSDN博客
3. 再次查看当前是否处于休眠模式
可以看到不再处于休眠模式
4. 重启systemd-logind服务
sudo systemctl restart systemd-logind
如果不重启还是会出现挂起状态
5. 重启系统
如果上面的操作都做完了之后可以尝试重启系统
原因:systemd-logind
的配置更改可能需要 完全重启系统 或 重新登录桌面会话 才能生效(某些桌面环境会缓存旧配置)(回答来自deepseek-R1,试了以后确实有用)