2

I have a brand-new Ubuntu 10.10 installed in a VMWare 7.1 Workstation. I am in a LAN and we're connected to Internet through a proxy which requires authentication.

I use 3 (three) browsers: The latest versions of Opera, Chrome and Firefox. Each one of them is set up to look for our proxy at the IP 192.168.3.1 (example given) and the port 8081. Each one of them finds the proxy, asks for the username and the password and after this connects correctly to the Internet.

The same thing applies for the Synaptic Package Manager: Having the correct proxy data in the Settings -> Preferences -> Network it works ok.

However the Ubuntu Software Center fails to install any package which I will choose. The error(s) is/are Authentication failure.

Also in Terminal issuing a sudo apt-get install mypackage the APT cannot connect to the needed repository to fetch the data from there.

Also I mention that I have set up in the Ubuntu's Main Menu in System -> Preferences -> Network Proxy Preferences the correct values for proxy (IP address, port and the authentication bits: username & password).

The interesting thing is that if I do the following steps, it works:

  1. Start the Synaptic.
  2. Start the Ubuntu Software Center.
  3. Choose something to install from Ubuntu Software Center. It will throw a 'Waiting for Synaptic to close...'
  4. Close the Synaptic.
  5. Install what you want from the Ubuntu Software Center. (and perhaps also from terminal - not tested)

What I'm missing? How can I set up other programs (mainly the Terminal and the Ubuntu Software Center) to succeed connecting to internet?

UPDATE: Yes, I've pressed the Apply changes system-wide... in the Ubuntu's Network Proxy's dialog.

4 Answers 4

4

I'm working in a similar environment, and I've solved the problem as follows:
1) install and configure CNTLM:
sudo apt-get install cntlm
sudo nano /etc/cntlm.conf
2) enter in cntlm.conf proxy settings & login credentials for your network
3) point your browser(s)' proxy settings to http://localhost:3128/
4) add these 3 lines to ~/.bashrc or to global /etc/bash.bashrc
export http_proxy=http://localhost:3128/
export https_proxy=http://localhost:3128/
export ftp_proxy=http://localhost:3128/
5) logout and login again: everything should work!

Bye

1
  • 4
    +1 for maintainability of this solution. However, for apt-get, it may be required to setup a proxy configuration in /etc/apt/apt.conf.d as well (in addition to the above). See this post for details. This is because (as thekorn mentioned in his answer) there is a known bug in software center regarding passing on proxy information.
    – koushik
    Oct 12, 2010 at 12:04
2

To set a proxy from a terminal you can do the following

export http_proxy='http://user:pass@host:port/'

or for a secure proxy

export https_proxy='http://user:pass@host:port/'

Add the respective line to ~/.bashrc to make the change permanent (and relogin).

Remember that it wouldn't work if there is any special character in your username or password.

1

No, I don't think you are missing anything, it is a bug which has already been reported as Bug 545134 on launchpad.

1

when I use this command to update my system.

sudo apt-get update

my terminal gets stuck with this statement showing

[Connecting to 10.10.3.254 (10.10.3.254)]

and nothing happens afterwards, I had to cancel the task. although I can access the internet with the browser.

The problem was due to proxy and I had applied the proxy earlier but later changed to none, but these steps do not configure the network, system wise

enter image description here

here in this situation set your proxy to none and apply changes system wide, and after that, your terminal works fine. I had the similar issue but i figured it out as I mentioned

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .