编辑下列文件: sudo vim /etc/systemd/logind.conf 然后将其中的: #HandleLidSwitch=suspend 改成下面,去掉“#”号: HandleLidSwitch=ignore 最后重启服务: service systemd-logind restart