Every time we install Ruby/Rails/Mysql/Rmagick/Vpn on Ubuntu Gutsy or Hardy we face the same errors again and again. Lets reduce the installation time and have a loop-back-fix-free or smooth installation experience.
After you run the CD or install Ubuntu, make sure of your Network Proxies if any, if so, you need to add the proxy url at System->preferences->Network Proxy.
then from terminal, make sure this passes…
sudo apt-get update
then for Mysql/Rails installation follow this:
and for VPN installation/connection on Ubuntu, this is the best guide: