I run debian linux on mine. I used the original imac as my only computer for a few months, while my desktop was having some issues. Worked well. I wrote a
tutorial on it. I prefer debian, especially on older machines, because you can customize what it runs, and what services are running a little bit better. Ubuntu tends to have a lot of extra bloat and crap running in the background, not good for older gear.