I have an Ubuntu 22.04 system on an HP 17 laptop. When the laptop is plugged into the charger, it does not charge (nor does it discharge). When I mouse over the battery indicator in the system tray, the tooltip says "Battery at 75%, not charging" and it stays that way indefinitely.
I've found many AskUbuntu and Stack Exchange posts on this issue. All of them offer solutions that don't work for me. For example, the most common resolution is to "hard reset" the power by turning the laptop off and holding the power button down for up to a minute before rebooting. I've tried this several times, and it does not change anything. Other things from other posts that don't work include BIOS fiddling (I don't have any of the relevant battery settings), recovery mode, and busctl
commands.
I have discovered, however, that when the laptop is completely powered off and plugged in, it charges normally. I just left it powered off for the past hour, and it's now at "Battery at 98%, not charging", up from 75%. This demonstrates that the battery itself and the laptop hardware are fully capable of charging; therefore, it must be an OS problem.
About a week ago I had a minor disaster in which I accidentally removed ~500 packages. I spent a day inspecting and re-installing each of these packages, and for the past week my machine has been functioning normally, with the exception of the charging problem. So, my best guess is that some package responsible for allowing the battery to charge must have been re-installed differently, or even missed. I'm trying to figure out what package to investigate.
I'm using the KDE Plasma DE. From a web search, I've found the Arch Wiki that indicates powerdevil
is responsible for power management. This is one of the packages that was removed, but I reinstalled it successfully:
$ apt-cache policy powerdevil
powerdevil:
Installed: 4:5.24.7-0ubuntu0.1
Candidate: 4:5.24.7-0ubuntu0.1
Version table:
*** 4:5.24.7-0ubuntu0.1 500
500 http://us.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages
100 /var/lib/dpkg/status
4:5.24.4-0ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
I can't find a record of what other packages I should expect to be relevant, so I'm asking here so that there's a record of it. What package or packages are required for Ubuntu 22.04 to be able to charge a battery?
The entire list of packages that were affected is enormous. I can post it if requested, but it seems like a huge info dump for small utility. Hopefully someone here can suggest the name of the needle I'm looking for within that haystack. If it helps, here is the standard battery diagnostic output:
$ upower -i /org/freedesktop/UPower/devices/battery_BAT0
native-path: BAT0
vendor: Hewlett-Packard
model: Primary
serial: 100000
power supply: yes
updated: Sun 09 Jul 2023 01:19:46 PM EDT (18 seconds ago)
has history: yes
has statistics: yes
battery
present: yes
rechargeable: yes
state: pending-charge
warning-level: none
energy: 27.726 Wh
energy-empty: 0 Wh
energy-full: 36.66 Wh
energy-full-design: 36.66 Wh
energy-rate: 0 W
voltage: 11.929 V
charge-cycles: 70
percentage: 75%
capacity: 100%
technology: lithium-ion
icon-name: 'battery-full-charging-symbolic'
Thanks.