Installing ubuntu is a breeze, as long as you have a second computer that you can google stuff on. Most questions can be answered by googling "linux(or ubuntu) + [your computer's model number]".
As for RAM in general, some RAM manufacturers have a great guide on their site as to what type of ram is compatible with what computers. I'll try and find it for you.
Here, I got it:
Memory upgrades, flash media, and usb storage at Crucial.com
Google is always your friend.