Our server is on a corporate network, which requires corporate proxy authentication (e.g. enter corporate username and password). This is not an issue on the Windows machines on that network - when a web browser is opened the user is prompted to authenticate. However, when using a browser on Linux, the user is not prompted to authenticate, the browser simply shows a message saying authentication is required.
Internet Access would be useful
At the moment I have to walk to my desk on another floor, if I need to look something up, because I cannot get Internet access from this machine, since I cannot (or do not know how to) authenticate. It would be useful to have the ability to authenticate, so I can use a web browser.
Packages cannot be updated
When I attempt to perform updates using sudo apt-get update
or sudo apt-get install [package]
, there are errors, which I believe are caused due to lack of authentication.
After performing sudo apt-get update
, I get errors like W: Failed to fetch [link] 401 Authorization Required
. (For some reason some http://us.archive.ubuntu.com trusty/ sources work correctly, and some throw the same error).
This is a major problem, as I need to be able to update packages on the server.
- I have installed
cntlm
viasudo apt-get install cntlm
(it works from one of the few Ubuntu repositories that randomly work). - I edited the configuration at
/etc/cntlm.conf
and added my username, the domain and the proxy. - I started the service (
sudo /etc/init.d/cntlm start
). - I tested the service (
sudo cntlm -I -M http://www.google.com/
) and the response wasConfig Profile 1/4... Auth not required (HTTP code: 307) Your proxy is open, you don't need another proxy
. - I tried performing
sudo apt-get update
again and still receive the same error message. (401 Authorization Required
) - (Whoops! My mistake! I see I need to configure
apt
proxy settings manually...) - I added the line
Acquire::http::Proxy "http://localhost:3128";
to/etc/apt/apt.conf
. - I restarted
cntlm
. (sudo /etc/init.d/cntlm stop
,sudo /etc/init.d/cntlm start
) - I performed
sudo apt-get update
... and it hit0% [Waiting for headers] [Waiting for headers] [Waiting for headers] [Waiting f
- and just stopped there.
Steps Taken (after asking)
- I performed
sudo apt-get clean
, before performingsudo apt-get update
- this started working and then stopped at19% [Waiting for headers]
- I performed
sudo apt-get clean
again, before performingsudo apt-get update
- this started working and then stopped at0% [Waiting for headers]
I tried this a third time (
sudo apt-get clean
,sudo apt-get update
) and it stopped at20% [Waiting for headers]
I researched this subsequent problem and found an answer on AskUbuntu, suggesting this may be an issue with IPv6 causing ICS to halt for a while, when it receives concurrent connections.
- I checked the
/etc/sysctl.conf
file and discovered the IPv6 already appears to be disabled... (The linesnet.ipv6.conf.all.disable_ipv6 = 1
,net.ipv6.conf.default.disable_ipv6 = 1
, andnet.ipv6.conf.lo.disable_ipv6 = 1
are already in the config file.) - (I'm now drawing a bit of a blank! The symptoms match the hypothesized IPv6 issue, however, if it is already disabled that doesn't seem to be able to be the cause)
- I performed
sudo apt-get clean
andsudo apt-get update
a fourth time (What the hell - why not?) and it hung on24% [Waiting for Headers]
this time, but first it hit a bunch of repositories. A repository which used to trigger errors did not do so now (http://cran.rstudio.com trusty /
) but one which used to trigger errors now triggered a different error,Received HTTP code 501 from proxy after CONNECT
.
GATEWAY_TIMEOUT
.