What you're describing has to be a failure of either the battery voltage sensor, Ubuntu's driver or handler for that sensor, or of the battery itself. Long run life rules out bad cells that would display as a dead battery, so it's either a sensor failure or a software issue. Try booting from live media (DVD or USB) and see if the battery display still reads zero. If it does, you have a hardware problem; otherwise, it's an issue with the software that reads and displays the output of the sensor and can likely be corrected with software solutions (reinstalling one or more packages, or worst case reinstalling Ubuntu clean).
I'm guessing it's the sensor (a software failure would likely give some result other than a consistent zero reading, such as loss of the battery icon entirely), but I don't know, for that machine, if that's inside the battery housing or on the machine's motherboard. If the battery is removable, you may be able to buy a replacement battery at a reasonable price from a third party (not Apple).
With bad cells ruled out, the only harm you'll risk by running with the machine as is, is not knowing how much run time you have left, so that's an option (adding a countdown timer widget set for less than your tested battery life would help avoid unexpected shutdowns).