debian关闭休眠

在Debian系统中如果想要关闭休眠功能,有以下几种方法:

  1. 使用命令行禁用休眠:
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
  1. 在图形界面中禁用休眠: 打开「设置」-「电源」,将「睡眠」选项设置为「永不」。

  2. 编辑配置文件禁用休眠: 打开文件 /etc/systemd/logind.conf,将以下内容添加到文件中:

HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=ignore

保存并重启系统。

继续阅读