I am using Ubuntu 16.04. Whenever I try to run sudo apt update, nothing gets updated, and the output is as follows:

Err:1 http://dl.google.com/linux/chrome/deb stable InRelease Could not connect to ( - connect (111: Connection refused) 
Err:2 http://gb.archive.ubuntu.com/ubuntu xenial InRelease Could not connect to ( - connect (111: Connection refused) 
Err:3 http://security.ubuntu.com/ubuntu xenial-security InRelease Could not connect to ( - connect (111: Connection refused) 
Err:4 http://gb.archive.ubuntu.com/ubuntu xenial-updates InRelease Unable to connect to 
Err:5 http://gb.archive.ubuntu.com/ubuntu xenial-backports InRelease Unable to connect to 
Err:6 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial InRelease Unable to connect to 
Reading package lists... Done 
W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/xenial/InRelease Could not connect to ( - connect (111: Connection refused) 
W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Unable to connect to 
W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease Unable to connect to 
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease Could not connect to ( - connect (111: Connection refused) 
W: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/InRelease Could not connect to ( - connect (111: Connection refused) 
W: Failed to fetch http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu/dists/xenial/InRelease Unable to connect to 
W: Some index files failed to download. They have been ignored, or old ones used instead.

No proxy running. No active firewall. Pinging the server in question works fine.

I am also unable to install any software packages due to unmet dependencies. My package manager seems to be completely messed up; not sure if the two are linked in any way so I made a separate question here for this: askubuntu.com/questions/1081041/apt-get-unmet-dependencies

  • 1
    Are you able to ping in terminal? – Kulfy Oct 4 '18 at 22:16
  • 1
    yes <satisfying required char count> – Lost Crotchet Oct 5 '18 at 0:56
  • Please ask about the unmet dependencies in another question. Try to install any package from the terminal and paste the complete error message that you get as plain text. It would certainly be helpful to solve the unmet dependencies error so that you could install nmap. – karel Oct 5 '18 at 1:04
  • 1
    ok sure I have a separate question for the unmet dependencies now: askubuntu.com/questions/1081041/apt-get-unmet-dependencies – Lost Crotchet Oct 5 '18 at 1:29
  • @LostCrotchet What is the current status of this question? Did you ever figure out what was causing the connect (111: Connection refused) error messages? If this question did not lead to a firm conclusion can it be closed as non-reproducible? – karel Jun 27 '20 at 6:23

The port you are trying to connect to is not open on the IP address that you are trying to connect to for one of the following reasons.

  1. You are connecting to the wrong IP address. Use nmap on the server with hostname of localhost (nmap localhost) to check if the server is running properly in the port you want, and on the client with your server's public IP address to check if the destination port is open.

  2. You did not open the port on your firewall(s) successfully.

  3. Your system is configured to use a local HTTP proxy for apt connections, and no such proxy is running (included in this answer for the sake of completeness although you commented that no proxy is running). Many companies and higher education institutions have restrictions in place which includes a policy to control the types of websites you can access.

  • I am not aware of any proxy running on my PC. Also, how do I know the right IP address I'm supposed to connect to and how do I change it? I thought all this is supposed to be taken care of behind the scenes? – Lost Crotchet Oct 5 '18 at 0:24
  • Also regarding the firewall - I have never accessed a firewall on ubuntu before, I'm not even aware that one exists? – Lost Crotchet Oct 5 '18 at 0:26
  • As I wrote step 3. was included in my answer only for the sake of completeness. apt normally takes care of everything behind the scenes but if you have a problem try ping -c 4 and nmap -Pn because that is an IP address that returned a connect (111: Connection refused) error. Both of these commands were successful on my computer. ufw firewall and iptables terminal programs are included by default in 16.04. – karel Oct 5 '18 at 0:40
  • 'ufw status' returns "Status: inactive" – Lost Crotchet Oct 5 '18 at 0:48
  • ping seems to work fine for me. I don't have nmap installed and I am unable to install it due to "unmet dependencies" - my package manager seems completely messed up :/ – Lost Crotchet Oct 5 '18 at 0:50

This might help you. https://ubuntuforums.org/showthread.php?t=1844030. You can also give this a try https://ubuntuforums.org/showthread.php?t=1844030.

  • You can include important points from the link provided since answers with links only aren't considered to be good answers. – Kulfy Oct 4 '18 at 22: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.