My 20" iMac G5 has been shutting down after seconds, or minutes, or many minutes. Advice that seemed most consistent with symptoms was over heating -- also seemed to happen on days when it was 100+ F outside (though this is inside). Never saw the red LED indicating over heating, but then it always had the back on when it shut down. Recommendation to clean out fans and replace heat sink compound, thus the parts order.
I vacuumed out and blew out the fans, though I saw no dirt/dust/crud accumulation. I found a guide for getting to the heat sink, but for a different version of the 20" iMac G5 (pictures don't the same). If the disassembly (47 steps) is the same for my model, I don't want to go there; at least one wire is likely to break in all that disassembly and reassembly.
I did find the OmniCleanz very effective, on my Mac Book and large TV.
The iMac is holding in there so far, have added a fan to move more air to the room corner behind it.
Since my backup LaCie hard drive appears to have failed (maybe a new power supply), my plan is to order a replacement large hard drive to capture what's on the internal hard drive, and prepare for a new iMac, which will also let me get past 10.5.8. This is cover all bases approach, just haven't decided what to do with the G5 if it hangs in there.
My experience with my apparently failed LaCie hard drive says don't buy a single, relatively unique, interface -- my Mac Book doesn't have a firewire port.
I again have suffered though terminology and designations, e.g., model numbers. Commercial electronics seem to have too many numbers to describe them, and literature and commentary often are arbitrary in choosing what designation to use. E.g., the "Axxxx" designation distinguishing my version of 20" iMac G5 from at least one other doesn't show up on my "About This MAC".