On Thu, Feb 16, 2023 at 1:42 PM <andreas.fournier@runbox.com> wrote:
So recently I've started to get this problem that the laptop dies even
when the battery indicator says there is something like 40% left, i.e.
I never get a low battery warning. Then when I plug it in and restart
it also says the battery is at something like 40%. The laptop is about
five years old.

Battery "health" can't be described by one number.  Old batteries often
have high "internal resistance" which means they work fine under moderate
loads, but voltage will drop under high loads, causing a system crash.  This
is why batteries no longer viable for EV use can be repurposed for use in
backup systems where loads don't spike they way they do in an EV. 
 

Is it possible to recalibrate the battery indicator so I would get a
warning when it is about to die?

I think you are outside the envelope where recalibration (which is
more about the measuring device than the battery) is meaningful.
 
--
George N. White III