If you're using a G3, none.
If you're using a G4 or G5, a retail version of 10.5 and not one which originally shipped with a Mac.
If you're using an Intel Mac, skip 10.5 and buy Mac OS X 10.6 from the online Apple Store.
If you don't know which type of iMac you have, choose About this Mac from the Apple menu.
If you have a PowerPC Mac (G4, G5), be forewarned that Classic, the Mac OS 9 environment that runs side by side with Mac OS X no longer works once you upgrade to 10.5 or later, and that 10.5 won't give you access to Boot Camp.
I agree if you have an Intel Mac, buying 10.6 or later is better. You can take it up to 10.6.8 minimum, if not something higher, though getting to something higher than 10.6.8 also requires you have 10.6.6 minimum on it unless you can find the USB Flash drive for 10.7.
https://discussions.apple.com/docs/DOC-2275 explains additional consequences of upgrading to 10.5
https://discussions.apple.com/docs/DOC-2455 explains what you need for 10.6
https://discussions.apple.com/docs/DOC-2465 explains what you need for 10.7
https://discussions.apple.com/docs/DOC-3761 explains what you need for 10.8
a brody wrote:
If you have a PowerPC Mac (G4, G5), be forewarned that Classic, the Mac OS 9 environment that runs side by side with Mac OS X no longer works once you upgrade to 10.5 or later...
You can run Classic software on the Intel Macs with SheepShaver, or its cousin, Chubby Bunny!