System wide Proxy settings when on a windows network with a password

I'm using Ubuntu on a windows network. I want to connect to the world wide web. I have followed the steps here which I have found very useful. However when I try to ping a website (eg: ping www.wikipedia.org) I get no reply. I can ping local computers on my network, but I need to go through our proxy to get to the world wide web.

I can even browse wikipedia using firefox, I just needed to enter the proxy configuration script location and my username and password.

I'm quite sure the reason I'm having this trouble is because I havn't entered a username and password. I'm not sure how to do this on a system wide level.

ultimately I would like to be able to use package managers like synaptic but first I need them to be able to connect to the internet.

EDIT

As sugested I created a /etc/apt/apt.conf file like

Acquire::http::Proxy "http://chrisav:[email protected]:8080";
Acquire::https::Proxy "https://chrisav:[email protected]:8080";
Acquire::ftp::Proxy "ftp://chrisav:[email protected]:8080";
Acquire::socks::Proxy "socks://chrisav:[email protected]:8080";

However I still cant ping wikipedia

when I try installing stuff I get

chris@chris-Ubuntu:~$ sudo apt-get install kate
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package kate

First of all, if you are behind a Web Proxy to go to the Internet, you cannot use ping to test the connection to Internet. This is because ping is not able to use any proxy to do its work, it is using its own protocol : ICMP to send and receive packet. Web proxies works only for the TCP protocol.

So if you are able to open any web site in your web browser, then you can be sure that your connection to Internet is working, no reason to do ping to double-check that.

Now regarding your problem with the package manager, if you go to System Settings -> Network, you can there define a Web Proxy configuration and apply it system-wide. When I do so on my laptop, I'm able to use apt-get without manually configuring Proxy directives into its configuration files. To work, you have to open your terminal after having clicked the Apply system-wide button. (Setting cannot be applied to already running program, only to those starting after you apply the settings).

UPD: More about Proxies and authentication

Another source of problem, as you are in Windows environment, may be the authentication mechanisms used on your web proxy. If this proxy is configured to use NTLM, it is possible that some application cannot authentify to it. In this case, what you can do is to install a local proxy supporting NTLM like cntlm, running it on 127.0.0.1 is enough and pointing it to your real Web Proxy. Then just use this local proxy as default proxy for your Ubuntu system.


Use this command and see if your Proxy setting is correct.

sudo gedit /etc/apt/apt.conf

It contains following content :

Acquire::http::Proxy "http://username:password@proxy-address:port/";
Acquire::https::Proxy "https://username:password@proxy-address:port/";
Acquire::ftp::Proxy "ftp://username:password@proxy-address:port/";
Acquire::socks::Proxy "socks://username:password@proxy-address:port/";

You must input your username password proxy-address and port instead of these id


You will need to modify your /etc/apt/apt.conf file correctly as follows:

Acquire::http::Proxy "http://username:password@proxy-address:port";
Acquire::https::Proxy "https://username:password@proxy-address:port";
Acquire::ftp::Proxy "ftp://username:password@proxy-address:port";
Acquire::socks::Proxy "socks://username:password@proxy-address:port";

Note the :: in place of : before Proxy, replacing username, password,proxy-addressandproxy` with the ones applicable to you.

Also, do note that, if you have special characters like @, you will need to replace them with their respective HTML codes.

And after you have done this, and if you have never updated your system, you will need to do:

sudo apt-get update

and then you will be able to install packages.

If this doesn't help, open your /etc/environment file (using gksudo gedit /etc/environment) and then type the following:

export http_proxy="http://username:password@proxy-address:port"
export https_proxy="https://username:password@proxy-address:port"
export ftp_proxy="ftp://username:password@proxy-address:port"
export socks_proxy="socks://username:password@proxy-address:port"

And then do source /etc/environment and then try again.