2

When I use sudo apt-get update, I get the following errors:

Err:1 http:/archive.ubuntu.com/ubuntu xenial InRelease
  Could not connect to localhost:4001 (127.0.0.1). - connect (111: Connection refused)
Err:2 http:/archive.ubuntu.com/ubuntu xenial-security InRelease
  Unable to connect to localhost:4001:
Err:3 http:/archive.ubuntu.com/ubuntu xenial-updates InRelease
  Unable to connect to localhost:4001:
Reading package lists... 4%
(process:2389): GLib-GIO-WARNING **: Invalid proxy URI 'http:/localhost:4001 ': Invalid URI 'http:/localhost:4001 '
Reading package lists... Done
W: Failed to fetch http:/archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Could not connect to localhost:4001 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch http:/archive.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Unable to connect to localhost:4001:
W: Failed to fetch http:/archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Unable to connect to localhost:4001:
W: Some index files failed to download. They have been ignored, or old ones used instead.

What can I do to fix this?

Eliah Kagan
  • 116,445
  • 54
  • 318
  • 493
  • 2
    Possible duplicate of [apt-get update cannot connect to server](http://askubuntu.com/questions/686130/apt-get-update-cannot-connect-to-server) – muru Jan 12 '17 at 07:59
  • 1
    Are you really running a proxy on your system? – muru Jan 12 '17 at 08:00
  • If you *are* trying to use a proxy, please explain in your question. If not, can you go into your network settings and [disable it system-wide](https://askubuntu.com/a/101127)? [Is the `http_proxy` environment variable set](https://askubuntu.com/a/344814)? If so, what happens when you unset it and try running `sudo apt-get update` again? Please [edit] your question to provide details about all this. If any of those suggestions fixes your problem we can mark this as a duplicate; otherwise, please paste the output of `grep -HFi proxy /etc/apt/apt.conf.d/*` (or mention if there's none). Thanks! – Eliah Kagan Jan 12 '17 at 08:01
  • Thank you Eliah for prompt reply. I am new to linux. I don't think, i use proxy. Once, I tried to use Tor but it did not work. I disabled it. I also tried all the comments on the other post that suggested . I ran grep -HFi..... in terminal and there was no output. – Mohammad Bagherieh Jan 12 '17 at 09:26
  • Try once this command "unset http_proxy" and then update. – BDRSuite Jan 12 '17 at 09:47
  • Hi Vembutech, I already did that. Not working! – Mohammad Bagherieh Jan 12 '17 at 11:08

1 Answers1

0

I think you either have lost internet connection, or are working behind a proxy. Either that or the ppas that you are trying to update have been deprecated.

If you are behind a proxy, this solution works: How to run "sudo apt-get update" through proxy in commandline?

Alo
  • 195
  • 12