A week ago, I found an old MacBook Pro 8,1 (13” MacBook Pro, Late 2011). It was working fine, but the battery wasn't charging. The charging lights on the side of the MacBook said that it was fully charged, but when I unplugged the charger, it turned off instantly.
Why is this happening and what can I do about it?
Note: I installed Ubuntu so that it would run faster, but I do have a backup of macOS.