我是 Ubuntu 的新手,也不是开发人员,不懂如何编写代码。几天前我下载了它,但它消耗了我的电池,它几乎持续了一个小时零几分钟,而使用 Windows 可以持续超过 3 个小时。
如何通过简单的步骤解决此问题?
答案1
做好以下几点,你的电池寿命会更长
sudo apt-get install indicator-cpufreq
将以下脚本放入/etc/pm/power.d/并赋予执行权限
sudo gedit /etc/pm/power.d/power
复制粘贴
#!/bin/sh
if on_ac_power; then
##### Start AC powered settings #####
# Disable laptop mode
echo 0 > /proc/sys/vm/laptop_mode
#NMI watchdog should be turned on
for foo in /proc/sys/kernel/nmi_watchdog;
do echo 1 > $foo;
done
# Set SATA channel: max performance
for foo in /sys/class/scsi_host/host*/link_power_management_policy;
do echo max_performance > $foo;
done
# CPU Governor: conservative NOT Performance
# Laptop get start heating up on Performance
# You can change the freq with indicator-cpufreq
for foo in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
do echo conservative > $foo;
done
# Disable USB autosuspend
for foo in /sys/bus/usb/devices/*/power/level;
do echo on > $foo;
done
# Disable PCI autosuspend
for foo in /sys/bus/pci/devices/*/power/control;
do echo on > $foo;
done
# Disable power saving for intel sound
echo 0 > /sys/module/snd_hda_intel/parameters/power_save
# Disable power saving for Wireless card
iw dev wlan0 set power_save off
# Disabling auto suspending USB
for i in /sys/bus/usb/devices/*/power/autosuspend;
do echo 2 > $i;
done
##### End AC powered settings #####
else
##### Start battery powered settings #####
# Enable Laptop-Mode disk writing
echo 5 > /proc/sys/vm/laptop_mode
#NMI watchdog should be turned on
for foo in /proc/sys/kernel/nmi_watchdog;
do echo 0 > $foo;
done
# Set SATA channel to power saving
for foo in /sys/class/scsi_host/host*/link_power_management_policy;
do echo min_power > $foo;
done
# Select conservative CPU Governor
for foo in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
do echo conservative > $foo;
done
# Activate USB autosuspend
for foo in /sys/bus/usb/devices/*/power/level;
do echo auto > $foo;
done
# Activate PCI autosuspend
for foo in /sys/bus/pci/devices/*/power/control;
do echo auto > $foo;
done
# Power Saving for INTEL sound
echo 1 > /sys/module/snd_hda_intel/parameters/power_save
# Power saving ON for Wireless
iw dev wlan0 set power_save on
# Auto Suspending USB devices
for i in /sys/bus/usb/devices/*/power/autosuspend;
do echo 1 > $i;
done
##### End battery powered settings #####
fi
使其可执行
sudo chmod +x /etc/pm/power.d/power
请查看以下链接
https://wiki.ubuntu.com/Kernel/PowerManagement/PowerSavingTweaks