If you are connecting to the internet behind a proxy in Ubuntu 12.04/11.10 or older, you can find this tutorial very useful because it will show you the steps to make your system update via proxy.
1. Open the terminal and issue this command:
sudo gedit /etc/apt/apt.conf
2. In this file, add this line and replace your own proxy details:
Replace all details marked in colors with your own proxy server access details. Then save your file and exit.