国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

目錄
What is TLP?
Install TLP in Linux
Enable and start TLP service
Optimize Laptop Battery Life with TLP in Linux
Disable USB auto suspend
Force battery (BAT) configuration
Frequently Asked Questions
Conclusion
首頁(yè) 系統(tǒng)教程 Linux 如何在Linux中使用TLP優(yōu)化筆記本電腦電池壽命

如何在Linux中使用TLP優(yōu)化筆記本電腦電池壽命

Mar 24, 2025 am 09:06 AM

There are quite a few tools exists to power saving and battery life extension in Laptops. We already have looked at two tools namely Laptop Mode Tools and Powertop that improves the Linux Laptop battery performance. Today we will discuss yet another Laptop power management utility named TLP. TLP is a feature-rich commandline tool to optimize Laptop battery life in Linux.

Table of Contents

What is TLP?

TLP is an advanced power management tool for Linux. Its goal is to improve battery life on laptops running Linux without the need for complex configurations.

TLP requires zero configuration. TLP comes with a default configuration that's already optimized for battery life. It implements Powertop's recommendations out of the box. So users can simply install it and forget about it.

Some of the things TLP handles include:

  • Power source-dependent configuration (whether you're running on battery or AC power)
  • Processor frequency scaling including "turbo boost" / "turbo core"
  • Power-saving settings for your hard disk or SSD
  • Runtime power management for PCI(e) bus devices
  • Wi-Fi power saving mode
  • And more.

TLP will apply these settings automatically depending on your power source. It's a great tool for Linux laptop users who want to maximize their battery life with minimal hassle.

TLP takes care of everything. Even though TLP's default settings are just enough to provide optimal battery life, it is highly customizable to fulfill a specific requirement.

Install TLP in Linux

TLP is packaged for many Linux distributions including Arch Linux, Debian, Fedora, Gentoo, openSUSE and Ubuntu.

To install TLP in Arch Linux and its variants, run:

$ sudo pacman -S tlp tlp-rdw

If you're using Thinkpad, you need to install any one of the following packages. If you don't know exactly which package to install, run tlp-stat -b command as sudo or root user. It will guide you which package to install.

  • acpi_call-lts (Community) – This is an optional external kernel module for the LTS kernel. It provides battery recalibration for ThinkPad models from the year 2011 onwards, such as the T420/X220 and newer models.
  • tp_smapi (Community) – This is an optional external kernel module. It provides battery charge thresholds and recalibration for ThinkPads made before the year 2011. It also provides specific tlp-stat -b output for models made until the year 2011.
  • tp_smapi-lts (Community) – This is optional. Use it instead of tp_smapi when the LTS kernel is installed.

Install the appropriate package using your preferred package manager or with the following command:

$ sudo pacman -S acpi_call

Replace acpi_call with acpi_call-lts, tp_smapi or tp_smapi-lts where suitable.

On Debian:

$ sudo apt install tlp tlp-rdw

If you are using any Thinkpad model Laptops, you may need to install any one of the following packages. The output of tlp-stat -b will guide you which package to install.

  • acpi-call-dkms (main) – This is an optional external kernel module that provides battery recalibration for ThinkPad models from the year 2011 onwards, such as the T420/X220 and newer.
  • tp-smapi-dkms (main) – This is an optional external kernel module. It provides battery charge thresholds and recalibration for ThinkPads made before the year 2011. It also provides specific tlp-stat -b output for models made until the year 2011.

Install the appropriate package using your preferred package manager or with the following command:

$ sudo apt install acpi-call-dkms

Replace 'acpi-call-dkms' with 'tp-smapi-dkms' as needed.

On Fedora:

$ sudo dnf install tlp tlp-rdw

If you use any Thinkpad model Laptops, install any one of the following packages. The dependencies of following packages are not available in the default repositories. So, first enable RPM Fusion repository in Fedora and then install the appropriate packages. If you don't know which package to install, run tlp-stat -b command as sudo or root user.

  • kernel-devel (Fedora repo) – This is required to build the kernel module from the akmod package.
  • akmod-tp_smapi (ThinkPad Extras repo) – This is an optional external kernel module source that provides battery charge thresholds and recalibration.

On openSUSE:

$ sudo zypper install tlp tlp-rdw

For Thinkpads, install the appropriate packages.

  • acpi_call – This is an optional external kernel module that provides battery recalibration for ThinkPad models from the year 2011 onwards, such as the T420/X220 and newer.
  • tp_smapi – This is an optional external kernel module. It provides battery charge thresholds and recalibration for ThinkPads made before the year 2011. It also provides specific tlp-stat -b output for models made until the year 2011.

On Ubuntu:

To install TLP in Ubuntu and its derivatives, add the TLP official PPA:

$ sudo add-apt-repository ppa:linrunner/tlp

And install TLP using command:

$ sudo apt install tlp tlp-rdw

For Thinkpad Laptops, install the appropriate packages:

  • acpi-call-dkms (PPA or universe) – This is an optional external kernel module that provides battery recalibration for ThinkPad models from the year 2011 onwards, such as the T420/X220 and newer.
  • tp-smapi-dkms (universe) – This is an optional external kernel module. It provides battery charge thresholds and recalibration for ThinkPads made before the year 2011. It also provides specific tlp-stat -b output for models made until the year 2011.

You can install the appropriate package either using your preferred package manager or with the following command:

$ sudo apt install acpi-call-dkms

If necessary, replace 'acpi-call-dkms' with 'tp-smapi-dkms'.

Again if you don't know which package to install, run tlp-stat -b command as sudo or root.

Enable and start TLP service

After installing TLP on your Linux machine, make sure it is enabled on startup and start the service using commands:

$ sudo systemctl enable tlp.service
$ sudo systemctl start tlp.service

You should also mask the following services to avoid conflicts and assure proper operation of TLP's Radio Device Switching options:

$ sudo systemctl mask systemd-rfkill.service
$ sudo systemctl mask systemd-rfkill.socket

Optimize Laptop Battery Life with TLP in Linux

As I already mentioned, TLP requires NO configuration. It works out of the box! The default settings are well optimized for better Laptop battery life. You can view these default settings in the TLP default configuration file, which is located at /etc/tlp.conf.

To view the current TLP configurion, system information, active power saving settings and battery data, run:

$ sudo tlp-stat

Sample output:

--- TLP 1.3.1 --------------------------------------------
 +++ Configured Settings:
 defaults.conf L0004: TLP_ENABLE="1"
 defaults.conf L0005: TLP_PERSISTENT_DEFAULT="0"
 defaults.conf L0006: DISK_IDLE_SECS_ON_AC="0"
 defaults.conf L0007: DISK_IDLE_SECS_ON_BAT="2"
 defaults.conf L0008: MAX_LOST_WORK_SECS_ON_AC="15"
 defaults.conf L0009: MAX_LOST_WORK_SECS_ON_BAT="60"
 defaults.conf L0010: CPU_ENERGY_PERF_POLICY_ON_AC="balance_performance"
 defaults.conf L0011: CPU_ENERGY_PERF_POLICY_ON_BAT="balance_power"
 defaults.conf L0012: SCHED_POWERSAVE_ON_AC="0"
 defaults.conf L0013: SCHED_POWERSAVE_ON_BAT="1"
 defaults.conf L0014: NMI_WATCHDOG="0"
 defaults.conf L0015: DISK_DEVICES="nvme0n1 sda"
 defaults.conf L0016: DISK_APM_LEVEL_ON_AC="254 254"
 defaults.conf L0017: DISK_APM_LEVEL_ON_BAT="128 128"
 defaults.conf L0018: DISK_IOSCHED="keep keep"
 defaults.conf L0019: SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance"
 defaults.conf L0020: SATA_LINKPWR_ON_BAT="med_power_with_dipm min_power"
 defaults.conf L0021: AHCI_RUNTIME_PM_TIMEOUT="15"
 defaults.conf L0022: PCIE_ASPM_ON_AC="default"
 defaults.conf L0023: PCIE_ASPM_ON_BAT="default"
 defaults.conf L0024: RADEON_POWER_PROFILE_ON_AC="default"
 defaults.conf L0025: RADEON_POWER_PROFILE_ON_BAT="default"
 defaults.conf L0026: RADEON_DPM_PERF_LEVEL_ON_AC="auto"
 defaults.conf L0027: RADEON_DPM_PERF_LEVEL_ON_BAT="auto"
 defaults.conf L0028: WIFI_PWR_ON_AC="off"
 defaults.conf L0029: WIFI_PWR_ON_BAT="on"
 defaults.conf L0030: WOL_DISABLE="Y"
 defaults.conf L0031: SOUND_POWER_SAVE_ON_AC="0"
 defaults.conf L0032: SOUND_POWER_SAVE_ON_BAT="1"
 defaults.conf L0033: SOUND_POWER_SAVE_CONTROLLER="Y"
 defaults.conf L0034: BAY_POWEROFF_ON_AC="0"
 defaults.conf L0035: BAY_POWEROFF_ON_BAT="0"
 defaults.conf L0036: BAY_DEVICE="sr0"
 defaults.conf L0037: RUNTIME_PM_ON_AC="on"
 defaults.conf L0038: RUNTIME_PM_ON_BAT="auto"
 defaults.conf L0039: RUNTIME_PM_DRIVER_BLACKLIST="amdgpu mei_me nouveau nvidia pcieport radeon"
/etc/tlp.conf L0323: USB_AUTOSUSPEND="0"
 defaults.conf L0041: USB_BLACKLIST_BTUSB="0"
 defaults.conf L0042: USB_BLACKLIST_PHONE="0"
 defaults.conf L0043: USB_BLACKLIST_PRINTER="1"
 defaults.conf L0044: USB_BLACKLIST_WWAN="0"
 defaults.conf L0045: USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN="0"
 defaults.conf L0046: RESTORE_DEVICE_STATE_ON_STARTUP="0"
 defaults.conf L0047: RESTORE_THRESHOLDS_ON_BAT="0"
 defaults.conf L0048: NATACPI_ENABLE="1"
 defaults.conf L0049: TPACPI_ENABLE="1"
 defaults.conf L0050: TPSMAPI_ENABLE="1"
 +++ System Info
 System         = Dell Inc. Not Specified Inspiron N5050
 BIOS           = A05
 Release        = "Fedora release 34 (Thirty Four)"
 Kernel         = 5.11.17-300.fc34.x86_64 #1 SMP Wed Apr 28 14:21:28 UTC 2021 x86_64
BOOT_IMAGE=(hd0,msdos1)/vmlinuz-5.11.17-300.fc34.x86_64 root=UUID=2dbf3f8b-de51-413e-8872-5fb61c06cb8f ro rootflags=subvol=root rhgb quiet
 Init system    = systemd 
 Boot mode      = BIOS (CSM, Legacy)
 SELinux status = enabled (enforcing)
<strong> +++ TLP Status
 State          = enabled
 RDW state      = enabled</strong>
 Last run       = 02:46:11 PM IST,     53 sec(s) ago
 Mode           = battery
 Power source   = battery
[...]

如何在Linux中使用TLP優(yōu)化筆記本電腦電池壽命

Disable USB auto suspend

When TLP is started with default configuration, some USB devices will be automatically suspended to save power when your Laptop is running on battery.

To disable USB autosuspend, edit /etc/tlp.conf file:

$ sudo nano /etc/tlp.conf

Find the following line and set its value as 0.

USB_AUTOSUSPEND=0

You can also exclude specific devices from USB autosuspend (separate with spaces). First, use lsusb command to get the ids. Then, mention the device ids with space-separated like below

USB_BLACKLIST="8078:0014 065d:8023"

Save and close the file by pressing CTRL+O followed by CTRL+X.

Force battery (BAT) configuration

When no power supply is detected, the setting for AC will be used on devices like desktops and embedded hardware. If you want to force the battery (BAT) settings when using TLP on these devices to enable more power saving, edit /etc/tlp.conf file:

$ sudo nano /etc/tlp.conf

Find the following lines and set their values as shown here:

# Operation mode when no power supply can be detected: AC, BAT.
TLP_DEFAULT_MODE=BAT

# Operation mode select: 0=depend on power source, 1=always use TLP_DEFAULT_MODE
TLP_PERSISTENT_DEFAULT=1

For more details, check the TLP website and its GitHub page given at the end.

Frequently Asked Questions

Q1: What is TLP?

A: TLP is a power management tool for Linux-based systems. It optimizes battery life by managing system settings such as power source preferences, CPU speed, hard disk spins, and Wi-Fi power saving.

Q2: Does TLP require configuration?

A: No, TLP comes pre-configured and generally works well with the default settings. However, users can modify its configuration to better suit their needs.

Q3: How do I install TLP?

A: TLP can be installed via the terminal using package management commands like apt for Debian/Ubuntu based systems, or dnf for Fedora systems.

Q4: Can TLP help with overheating issues?

A: Yes, TLP can help manage system heat by intelligently controlling system settings that affect power consumption and heat generation.

Q5: How do I check if TLP is running?

A: You can check if TLP is running by using the terminal command sudo tlp-stat -s.

Q6: Does TLP work on all laptops?

A: TLP is designed to work with most modern laptops, but its effectiveness may vary depending on the specific model and hardware.

Q7: Can I use TLP on desktop systems?

A: While TLP is primarily designed for laptops, it can also be used on desktop systems for some of its features. However, the benefits on a desktop may be less noticeable.

Q8: Is TLP free to use?

A: Yes, TLP is open-source and free to use. It's licensed under GPLv2.

Conclusion

TLP is one of the recommended application that you should install on your Linux laptop. It is also worth mentioning that you should not use multiple power saving utilities simultaneously. The TLP’s settings get overwritten by the other tools settings and vice versa, so you may not get optimal result. It is always recommended to use only TLP and remove other similar tools.

Resources:

  • TLP website
  • TLP GitHub Repository

Related read:

  • Automatically Optimize CPU Speed And Power With Auto-cpufreq In Linux
  • CPU Power Manager – Control And Manage CPU Frequency In Linux
  • How To Check Laptop Battery Status And Level In Terminal In Linux

Featured image by mohamed Hassan from Pixabay.

以上是如何在Linux中使用TLP優(yōu)化筆記本電腦電池壽命的詳細(xì)內(nèi)容。更多資訊請(qǐng)關(guān)注PHP中文網(wǎng)其他相關(guān)文章!

本網(wǎng)站聲明
本文內(nèi)容由網(wǎng)友自願(yuàn)投稿,版權(quán)歸原作者所有。本站不承擔(dān)相應(yīng)的法律責(zé)任。如發(fā)現(xiàn)涉嫌抄襲或侵權(quán)的內(nèi)容,請(qǐng)聯(lián)絡(luò)admin@php.cn

熱AI工具

Undress AI Tool

Undress AI Tool

免費(fèi)脫衣圖片

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅(qū)動(dòng)的應(yīng)用程序,用於創(chuàng)建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費(fèi)的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費(fèi)的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強(qiáng)大的PHP整合開(kāi)發(fā)環(huán)境

Dreamweaver CS6

Dreamweaver CS6

視覺(jué)化網(wǎng)頁(yè)開(kāi)發(fā)工具

SublimeText3 Mac版

SublimeText3 Mac版

神級(jí)程式碼編輯軟體(SublimeText3)

5 Linux的最佳開(kāi)源數(shù)學(xué)方程式編輯器 5 Linux的最佳開(kāi)源數(shù)學(xué)方程式編輯器 Jun 18, 2025 am 09:28 AM

您是否正在尋找編寫(xiě)數(shù)學(xué)方程式的好軟件?如果是這樣,本文提供了前5個(gè)方程式編輯器,您可以輕鬆地在自己喜歡的Linux發(fā)行版上安裝。

SCP Linux命令 - 在Linux中安全傳輸文件 SCP Linux命令 - 在Linux中安全傳輸文件 Jun 20, 2025 am 09:16 AM

Linux管理員應(yīng)熟悉命令行環(huán)境。由於通常不安裝Linux服務(wù)器中的GUI(圖形用戶界面)模式。 SSH可能是使Linux管理員能夠管理服務(wù)器的最受歡迎的協(xié)議

gogo-在Linux中創(chuàng)建到目錄路徑的快捷方式 gogo-在Linux中創(chuàng)建到目錄路徑的快捷方式 Jun 19, 2025 am 10:41 AM

Gogo是在Linux Shell內(nèi)書(shū)籤目錄的非凡工具。它可以幫助您在Linux中為長(zhǎng)而復(fù)雜的路徑創(chuàng)建快捷方式。這樣,您不再需要在Linux上鍵入或記住冗長(zhǎng)的路徑。例如,如果有目錄

什麼是PPA,如何將其添加到Ubuntu? 什麼是PPA,如何將其添加到Ubuntu? Jun 18, 2025 am 12:21 AM

PPA是Ubuntu用戶擴(kuò)展軟件源的重要工具。 1.查找PPA時(shí)應(yīng)訪問(wèn)Launchpad.net,確認(rèn)項(xiàng)目官網(wǎng)或文檔中的官方PPA,並閱讀描述與用戶評(píng)論確保其安全性和維護(hù)狀態(tài);2.添加PPA使用終端命令sudoadd-apt-repositoryppa:/,之後運(yùn)行sudoaptupdate更新包列表;3.管理PPA可通過(guò)grep命令查看已添加列表,使用--remove參數(shù)移除或手動(dòng)刪除.list文件,避免因不兼容或停止更新引發(fā)問(wèn)題;4.使用PPA應(yīng)權(quán)衡必要性,優(yōu)先選擇官方未提供或需新版軟件的情況

在RHEL,Rocky和Almalinux中安裝LXC(Linux容器) 在RHEL,Rocky和Almalinux中安裝LXC(Linux容器) Jul 05, 2025 am 09:25 AM

LXD被描述為下一代容器和虛擬機(jī)管理器,它為在容器內(nèi)部或虛擬機(jī)中運(yùn)行的Linux系統(tǒng)提供了沉浸式的。 它為有支持的Linux分佈數(shù)量提供圖像

如何創(chuàng)建特定大小的文件以進(jìn)行測(cè)試? 如何創(chuàng)建特定大小的文件以進(jìn)行測(cè)試? Jun 17, 2025 am 09:23 AM

如何快速生成指定大小的測(cè)試文件?使用命令行工具或圖形化軟件均可實(shí)現(xiàn)。 Windows上可用fsutilfilecreatenew文件名大小生成指定字節(jié)的文件;macOS/Linux可用ddif=/dev/zeroof=文件bs=1Mcount=100生成真實(shí)數(shù)據(jù)文件,或用truncate-s100M文件快速創(chuàng)建稀疏文件。若不熟悉命令行,可選用FSUtilGUI、DummyFileGenerator等工具軟件。注意事項(xiàng)包括:注意文件系統(tǒng)限制(如FAT32文件大小上限)、避免覆蓋已有文件、部分程序可能

NVM-在Linux中安裝和管理多個(gè)node.js版本 NVM-在Linux中安裝和管理多個(gè)node.js版本 Jun 19, 2025 am 09:09 AM

Node版本管理器(NVM)是一個(gè)簡(jiǎn)單的BASH腳本,可幫助您在Linux系統(tǒng)上管理多個(gè)Node.js版本。它使您可以安裝各種node.js版本,查看可用的安裝版本,並檢查已經(jīng)安裝的版本。

如何與Windows一起安裝Linux(雙啟動(dòng))? 如何與Windows一起安裝Linux(雙啟動(dòng))? Jun 18, 2025 am 12:19 AM

安裝Linux和Windows雙系統(tǒng)的關(guān)鍵是分區(qū)和啟動(dòng)設(shè)置。 1.準(zhǔn)備工作包括備份數(shù)據(jù)並壓縮現(xiàn)有分區(qū)騰出空間;2.使用Ventoy或Rufus製作Linux啟動(dòng)U盤,推薦Ubuntu;3.安裝時(shí)選擇“與其他系統(tǒng)並存”或手動(dòng)分區(qū)(/至少20GB,/home剩餘空間,swap可選);4.勾選安裝第三方驅(qū)動(dòng)以避免硬件問(wèn)題;5.安裝後若未進(jìn)入Grub引導(dǎo)菜單,可用boot-repair修復(fù)引導(dǎo)或調(diào)整BIOS啟動(dòng)順序。只要步驟清晰、操作得當(dāng),整個(gè)過(guò)程並不復(fù)雜。

See all articles