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.


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

Acquire::http::Proxy "http://chrisav:password@myproxy.com.au:8080";
Acquire::https::Proxy "https://chrisav:password@myproxy.com.au:8080";
Acquire::ftp::Proxy "ftp://chrisav:password@myproxy.com.au:8080";
Acquire::socks::Proxy "socks://chrisav:password@myproxy.com.au: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 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

  • Do I need to include a domain name in there anywhere?
    – sav
    Jun 12 '14 at 7:13
  • Thanks, I'm getting an error though chris@chris-Ubuntu:~$ sudo apt-get install synaptic E: Syntax error /etc/apt/apt.conf:7: Extra junk at end of file
    – sav
    Jun 12 '14 at 7:14
  • Post your apt.conf file in your question.Please Jun 12 '14 at 7:19
  • 1
    Put semicolon ; at the end of each line and save it again. And Also Note the :: in place of : before Proxy Jun 12 '14 at 7:30
  • I've just added the ; in
    – sav
    Jun 12 '14 at 7:34

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.

  • well spotted, I have added the extra : character now as well. Still no luck
    – sav
    Jun 12 '14 at 7:38
  • @sav: answer edited, have a look.
    – jobin
    Jun 12 '14 at 7:39
  • @sav: You need to do sudo apt-get update before you do sudo apt-get install kate.
    – jobin
    Jun 12 '14 at 7:57
  • Hmm yes, but the problem is I'm still not getting through to the internet so this just gets stuck at 0%
    – sav
    Jun 12 '14 at 8:07
  • Does your password have any special character, if yes, have you replaced them with their HTML codes?
    – jobin
    Jun 12 '14 at 8:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.