How to calibrate the laptop battery on 12.04

Have you tried power-calibrate ?

sudo apt install power-calibrate

then run

power-calibrate -r

You can read the manual or run man power-calibrate for more information.


Update
As per the latest version of power-calibrate, use this command

power-calibrate  -R -r 20 -d 5 -s 21 -n 0 -p

Where

-d secs  specify a delay before starting
-h show  help
-n CPUs  specify the number of CPUs to exercise
-o file  output results into YAML formatted file
-p       show progress
-r secs  specify run duration in seconds of each test cycle
-R       use Intel RAPL per CPU package data to measure Watts
-s num   number of samples (tests) per CPU for CPU calibration