20

I have tried put in apt config Acquire::http::proxy, and in Network>Network proxy with and without user:password@server:port and using environment variables http_proxy and https_proxy. Nothing seems to work, not even a single proxy authentication popup window.

The only proxy configuration working is within Firefox Edit> Preferences> Advanced> Network> Connection> Settings> Manual Proxy Configuration.

  • Using gconf to manually set the proxy doesn't work

Using Synaptic in previous Ubuntu versions was too simple.

3

9 Answers 9

13

Go to /etc/apt. Create the file apt.conf if you don't have it there. Write the following lines there.

Acquire::http::proxy "http://username:password@proxyserver:port/";
Acquire::https::proxy "https://username:password@proxyserver:port/";
Acquire::socks::proxy "socks://username:password@proxyserver:port/";

Save it. You are done.

4
  • 9
    storing passwords in a text file is an awful suggestion Mar 31, 2014 at 12:00
  • 1
    @BЈовић i agree. what's the alternative? Jan 11, 2016 at 22:03
  • @SHA1 I would write an answer if I knew :) Jan 12, 2016 at 8:14
  • @BЈовић One possible alternative to not storing passwords in apt.conf: First access internet using a web browser. Enter your access credentials if required. Once connected, the proxy probably caches your access for some period. Now apt should be able to access internet, with just the proxy name and port in apt.conf. This is general should work for any other application as well.
    – amolbk
    Jan 10, 2019 at 9:00
5

I had the same problem. However I did have success by setting Acquire::http::proxy in /etc/apt/apt.conf in the format

Acquire::http::proxy "http://user:pass@host:port/";

Note, I initially followed a recommendation somewhere on the web to put this in /etc/apt.conf. The correct path is /etc/apt/apt.conf

0
1

In the dash button, select the "Network" option. In the network configuration screen you should select "network proxy" > "manual", type your proxy data and finally "Apply to all system". If authentication is required, the login screen will appear.

Another option is to configure directly using the gconftool:

gconftool-2 -t string -s /system/http_proxy/host "YOUR_PROXY_ADDRESS"
gconftool-2 -t int -s /system/http_proxy/port PROXY_PORT
gconftool-2 -t bool -s /system/http_proxy/use_http_proxy true

I hope this help.

1
  • As I already have stated the configuration in Network>Network proxy>Manual with or without user:password is not working for proxies with authentication, it was my first option. And using gconftool command line, as suggested, haven't worked either. :(
    – Augusto
    Nov 9, 2011 at 17:35
0

Well this worked - however it didn't work to just use Acquire::http::proxy "http://host:port/" - I had to use Acquire::http::proxy "http://user:pass@host:port/" even though I haven't a password on the proxy (I just did use "user and pass" to keep the syntax).

1
  • The question was about using auth (i.e. having a password)
    – tumbleweed
    Nov 7, 2012 at 8:03
0

I had set proxy details in System → Network and applied system wide but was unable to use the Software Center (Firefox was fine).

I do need to enter a username and password but my actual username and password entered in that string wouldn't work, but when I just put in the actual words "user:pass" the Software Center started working!

0

You need to confirm that your username or password must not contain : or @ in it. I had a similar problem and it was solved when I changed my password.

1
  • with a curiosity i want to know why its giving back a problem ?
    – Raja G
    Oct 14, 2012 at 14:55
0

I've applied all of the above and none of it works for me AT FIRST, even though wget, apt-get, curl, web browsing, thunderbird and suchlike have all worked perfectly for years. Only software centre didn't work.

However, I left it with a grey screen for 2-4 minutes after applying the fix to /etc/apt/apt.conf:

      Acquire::http::proxy "http://user:pass@host:port/"

and then magically it began to work.

0

I have made a python script to set the proxy settings in Ubuntu

Assume the following setting, you need to replace at relevant places

  • proxy_address 172.16.26.214
  • proxy_port 3128
  • proxy_username king
  • proxy_password queen

I have made a video which takes you through all the steps:
Youtube - Setting Simple and Authenticated Proxy Settings in Ubuntu 12 13 14 and above 100% Working.

Steps are Detailed here:

  • First click on Dash
  • In Search Box Enter "Proxy" (Without Quotes)
  • Click on "Network" under Applications
  • Select "Network Proxy"
  • Select Manual
  • Enter the proxy address and proxy port
  • Apply. Enter your system password to confirm

Download the script setproxy.py

https://dl.dropboxusercontent.com/u/397422/setproxy.py

OR

https://copy.com/ezPIBHwKhg3Ki8f6

Let’s say you have saved the setproxy.py in the Downloads folder

  • Open terminal Type
  • cd ~/Downloads

General Command:
sudo python setproxy.py proxy_address proxy_port proxy_username proxy_password
For our example

  • sudo python setproxy.py 172.16.26.214 3128 king queen

In case of simple proxy Without authentication the command is:

  • sudo python setproxy.py 172.16.26.214 3128

In case you have python 3 and above run using python2.7 so the commands will look like

  • sudo python2.7 setproxy.py 172.16.26.214 3128
  • sudo python2.7 setproxy.py 172.16.26.214 3128 king queen
0

Here is a link to a python program named UBPROXY . Given below are the steps to set proxy Authentication.

http://code.google.com/p/ubproxy/downloads/detail?name=ubproxy

command to use->

1.download this program.

2.open your terminal

3."cd ~/Downloads" (Presuming that your download exist in this directory)

4."chmod +x ubproxy"

5."sudo ./ubproxy"

You must log in to answer this question.

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