Proxy Authentication with Synaptic Packag Manager

Asked by zimnative

I'm trying to upgrade using Synaptic Package Manager but it's coming up with this error "407 Proxy Authentication Required". Our office internet connection uses a proxy that requires authentication. I've set up the username & password in Mozilla & I can browse. Where do I set up the username & password for Synaptic Package Manage?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu synaptic Edit question
Assignee:
No assignee Edit question
Solved by:
Dean Sas
Solved:
Last query:
Last reply:
Revision history for this message
Dean Sas (dsas) said :
#1

In synaptic go to settings, then preferences then network.

Revision history for this message
zimnative (tennysonma) said :
#2

You can only input proxy address & port number in network under preferences. There's nowhere to input username & password.

Revision history for this message
Dean Sas (dsas) said :
#3

I'm not sure if this works but I think you need to put in the username and password in the proxy field like so:
username:<email address hidden>

Alternatively you can edit the /etc/apt/apt.conf file and add lines like so:

Acquire::http::Proxy "http://username:password@proxy:port";
Acquire::ftp::Proxy "ftp://username:password@proxy:port";

Revision history for this message
zimnative (tennysonma) said :
#4

I've edited the proxy field in under preferences network & the /etc/apt/apt.conf file & added the lines but I still can't get no joy.

Revision history for this message
Dean Sas (dsas) said :
#5

sorry, did you run "sudo apt-get update" after?

Revision history for this message
S.Sekar (ssekar-in) said :
#6

I had the same problem. Adding the lines in apt.conf as above worked for me.
Thanks.

Revision history for this message
S.Sekar (ssekar-in) said :
#7

 I mean I am able to run apt-get update now after giving the apt.conf lines as above.

Revision history for this message
zimnative (tennysonma) said :
#8

I hadn't run "sudo apt-get update" after editing "/etc/apt/apt.conf". I'm now able to upadte. Thanx a mill Dean Sas.

Revision history for this message
doina.babu (doinababu) said :
#9

The env variables:
http_proxy=http://user:password@hostname:port
ftp_proxy=ftp://user:password@hostname:port
are the most prioritary. This means that apt is using them even though you have set the proxy authentication in apt.conf.
If these variables are not set, then the settings from /etc/apt/apt.conf are used by apt. apt.conf is also used by Synaptic.
The network proxy authentication from Ubuntu, System/Preferences/Network Proxy, also sets the http_proxy and ftp_proxy variables but it sets them wrong without using the user and password you provided. For example, the http_proxy variable will be: "http://hostname:port". So, don't try to set the proxy authentication from here, it just messes things.
The same thing happens for the proxy setting in Synaptic (Settings/Preferences/Network). Probably this is the most prioritary for Synaptic proxy settings, but it doesn't have proxy authentication, so, in this case is useless.

My working configuration is:
-Leave System/Preferences/Network Proxy unfilled
-Leave the Synaptic Settings/Preferences/Network on Direct Connection to Internet
-edit the /etc/apt/apt.conf like Dean Sas stated above.
-additionally put in /home/user/.basrc the following lines
export http_proxy=http://user:password@hostname:port
export ftp_proxy=ftp://user:password@hostname:port

sudo apt-get update should work... Synaptic should work too ... but not in the same time (lock problems...)

Revision history for this message
Kim Tucker (ktucker) said :
#10

I also had a problem with a proxy setting for synaptic (a typo). For some reason Synaptic would freeze if I tried to change it using the GUI (Settings/ .../Network/....
Fixed the typo by editing /root/.synaptic/synaptic.conf - then it worked again :-).

Revision history for this message
Augustin (ubuntu-ackr) said :
#11

Hi,
I want to configure synaptic with the command:
username:<email address hidden>

The problem is that my username is: "<email address hidden>"

What can I do ?

Revision history for this message
Berend De Schouwer (berend-de-schouwer) said :
#12

Bug # 105415 has a patch that should fix Synaptic so you can setup Gnome->System->Preferences->Network Proxy, you can leave /etc/apt/apt,conf.d/ alone, and you can just setup Synaptic Proxy Preferences they way they are meant to work.

Revision history for this message
Chakkaradeep (chakkaradeep) said :
#13

This does not work totally in Feisty too ! Why isnt a fix been released !

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) said :
#14

Can you try this:-

Remove any proxy configuration from /etc/apt/ that you may have added. Open a terminal and do this:-

export http_proxy=http://username\@domain:password@proxyaddress:port/

Note the \ before the first @

Then in that same terminal run

sudo apt-get update

And see if it can reach the internet.

sudo synaptic

And see if that can reach the internet.

Revision history for this message
NHO3 (jfontenot) said :
#15

I am having the same problem except this file doesnt exist on my machine /etc/apt/apt.conf

I am a Linux newb. When I try to create the file it says I dont have permission but I am in the same group as root. Also I don't know what root's password is. When I installed Ubuntu it didn't ask me for a password to set for root. I have some basic understanding of how Linux works. I am sick of M$ Windows crap. Please help me get Ubuntu working so I can transition into Linux. I am working at my workstation right now on a VM virtual machine. We have a proxy here that uses a user name and password. I tried Fedora and no matter what I did it would never authenticate with the proxy, although Firefox was able to authenticate and access websites.

I also tried this in terminal but it didnt help export http_proxy=http://username:password@proxyaddress:port/

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) said :
#16

NHO3, if you have a specific question, you are better off reporting your own support request rather than replying to an existing one.

You may want to note my last reply though, which details how to use a username and password with a windows domain and a proxy.

Also, please read this page about the use of sudo and root:-

http://wiki.ubuntu.com/RootSudo

Revision history for this message
NHO3 (jfontenot) said :
#17

I get proxy error. I have created the apt.conf file and put the following in it.
Acquire::http::Proxy "http://user:<email address hidden>:port/";
Acquire::ftp::Proxy "http://user:<email address hidden>:port/";

sudo apt-get update gives me proxy errors.

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) said :
#18

What proxy error?

Revision history for this message
NHO3 (jfontenot) said :
#19

407 Proxy Authentication Required Access to the web proxy service is denied.

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) said :
#20

Should you not use the domain and proxy as I previously mentioned?

export http_proxy=http://username\@domain:password@proxyaddress:port/

Revision history for this message
NHO3 (jfontenot) said :
#21

I have tried and it gives same error.

Revision history for this message
NHO3 (jfontenot) said :
#22

I tried it in the command line again as u mentioned above and now I get error 111 connection refused 91.189.89.8. I would assume this means the proxy is connecting but the site is not responding?

Revision history for this message
praxis22 (praxis22) said :
#23

NHO3,

This problem appears related to MSproxy, this means, just like me, you can't get around it using basic authentication.

That said, I did get it to work by using another proxy, namely this one:

http://ntlmaps.sourceforge.net/

This is a python script that forges an NTLM authentication session. Gotta love Microsoft. Always coming up with new "standards" :)

You have to edit the server.cfg file to contain all your details; Proxy, port, NT domain, userID, password, etc. then you run main.py in the background and set your proxy variables to 127.0.0.1:5865

You can add this stuff to your .bashrc as follows:

export http_proxy="http://127.0.0.1:5865"
export ftp_proxy="http://127.0.0.1:5865"
/home/<account>/ntlmaps-0.9.9.0.1/main.py &

Where <account> is your ubuntu login ID, and the version is 0.9.9.0.1

so if your login was NH03

The line would be:

/home/NH03/ntlmmaps-0.9.9.0.1/main.py &

This will start the proxy in the background each time you login.

By default it will slow you down a bit since it limits the number of simultaneous requests to 5, but you can increase this too.

The only thing the script doesn't like/handle is if your password contains "whitespace" characters, like " " or tab, etc. Make sure you have a normal alphanumeric password. This will likely mean you have have to reset you Windows password, if you have spaces in it, etc. However once that's done it works like a charm first time.

Good luck.

Revision history for this message
Cedric Roussel (r-jonathancedric) said :
#24

The Last One Works for me... :P