Sometimes it is a pain in the ass to get a proxy working properly in Ubuntu. Especially when you try to update Ubuntu.
Go to System, Preferences, Networkproxy

Edit your /etc/apt/apt.conf file as root.
Put these line at the end of your /etc/apt/apt.conf file :

Acquire::http::Proxy "http://username:password-AT-proxyserver:port/"

Acquire::http::proxy "http://<username>:<password>@<proxyserver>:<proxyport>/";
Acquire::ftp::proxy "ftp://<username>:<password>@<proxyserver>:<proxyport>/";
Acquire::https::proxy "https://<username>:<password>@<proxyserver>:<proxyport>/";

The last option is really secure. If a hacker obtains your /etc/apt/apt.conf then the hacker knows your proxy credentials.
But if the hacker was capable to get to read your apt.conf file, I think you got p0wned anywayz...