4
turtlebot@turtlebot-bot:~$ sudo apt-get update

Err:1 http://ports.ubuntu.com xenial InRelease Could not connect to localhost:9999 (127.0.0.1). - connect (111: Connection refused)

Err:2 http://ports.ubuntu.com xenial-updates InRelease Unable to connect to localhost:9999:

Err:3 http://ports.ubuntu.com xenial-security InRelease Unable to connect to localhost:9999:

Err:4 http://ports.ubuntu.com xenial-backports InRelease Unable to connect to localhost:9999:

Err:5 http://ppa.launchpad.net/flexiondotorg/minecraft/ubuntu xenial InRelease Could not connect to localhost:9999 (127.0.0.1). - connect (111: Connection refused)

Err:6 http://ppa.launchpad.net/ubuntu-mate-dev/welcome/ubuntu xenial InRelease Unable to connect to localhost:9999:

Err:7 http://packages.ros.org/ros/ubuntu xenial InRelease
Could not connect to localhost:9999 (127.0.0.1). - connect (111: Connection refused)

Err:8 http://ppa.launchpad.net/ubuntu-mate-dev/xenial-mate/ubuntu xenial InRelease Unable to connect to localhost:9999:

Err:9 http://ppa.launchpad.net/ubuntu-pi-flavour-makers/ppa/ubuntu xenial InRelease Unable to connect to localhost:9999:

Err:10 http://ppa.launchpad.net/wireshark-dev/stable/ubuntu xenial InRelease

Unable to connect to localhost:9999: Reading package lists... Done

W: Failed to fetch http://ports.ubuntu.com/dists/xenial/InRelease Could not connect to localhost:9999 (127.0.0.1). - connect (111: Connection refused)

W: Failed to fetch http://ports.ubuntu.com/dists/xenial-updates/InRelease Unable to connect to localhost:9999:

W: Failed to fetch http://ports.ubuntu.com/dists/xenial-security/InRelease Unable to connect to localhost:9999:

W: Failed to fetch http://ports.ubuntu.com/dists/xenial-backports/InRelease Unable to connect to localhost:9999:

W: Failed to fetch http://ppa.launchpad.net/flexiondotorg/minecraft/ubuntu/dists/xenial/InRelease Could not connect to localhost:9999 (127.0.0.1). - connect (111: Connection refused)

W: Failed to fetch http://packages.ros.org/ros/ubuntu/dists/xenial/InRelease Could not connect to localhost:9999 (127.0.0.1). - connect (111: Connection refused)

W: Failed to fetch http://ppa.launchpad.net/ubuntu-mate-dev/welcome/ubuntu/dists/xenial/InRelease Unable to connect to localhost:9999:

W: Failed to fetch http://ppa.launchpad.net/ubuntu-mate-dev/xenial-mate/ubuntu/dists/xenial/InRelease Unable to connect to localhost:9999:

W: Failed to fetch http://ppa.launchpad.net/ubuntu-pi-flavour-makers/ppa/ubuntu/dists/xenial/InRelease Unable to connect to localhost:9999:

W: Failed to fetch http://ppa.launchpad.net/wireshark-dev/stable/ubuntu/dists/xenial/InRelease Unable to connect to localhost:9999:

W: Some index files failed to download. They have been ignored, or old ones used instead.

turtlebot@turtlebot-bot:~$ lsb_release -a

No LSB modules are available.

Distributor ID: Ubuntu

Description: Ubuntu 16.04.3 LTS

Release: 16.04

Codename: xenial

PS: I didn't know the stack exchange culture. I was down voted by 5 when I published this same question in electronics.stackexchange.com as it was a question from turtlebot3-burgerbot. Anyways, I'm a novice in Linux realm and desperate to look for an answer. Thank you.

14
  • Please post the output of "dig ports.ubuntu.com" and "dig ppa.launchpad.net" Jul 23, 2018 at 20:33
  • @Bernard; <<>> DiG 9.10.3-P4-Ubuntu <<>> ports.ubuntu.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33761 ;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;ports.ubuntu.com. IN A ;; ANSWER SECTION: ports.ubuntu.com. 700 IN A 91.189.88.150 ;; Query time: 1 msec ;; SERVER: 127.0.1.1#53(127.0.1.1) ;; WHEN: Mon Jul 23 15:59:10 CDT 2018 ;; MSG SIZE rcvd: 50
    – sujeet
    Jul 23, 2018 at 21:26
  • 1
    It looks like you configured your system to use a proxy (localhost:9999) at some point? Jul 23, 2018 at 21:40
  • @Bernard dig ppa.launchpad.net ; <<>> DiG 9.10.3-P4-Ubuntu <<>> ppa.launchpad.net ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4745 ;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;ppa.launchpad.net. IN A ;; ANSWER SECTION: ppa.launchpad.net. 654 IN A 91.189.95.83 ;; Query time: 1 msec ;; SERVER: 127.0.1.1#53(127.0.1.1) ;; WHEN: Mon Jul 23 16:39:51 CDT 2018 ;; MSG SIZE rcvd: 51
    – sujeet
    Jul 23, 2018 at 21:44
  • @SujeetPoudel would be easier to read if you update your original questions but nevertheless, I can see that it is okay in resolving the IP's so that localhost:9999 is more likly a proxy issue as indicated by steeldriver Jul 23, 2018 at 21:48

1 Answer 1

10

The error

Could not connect to localhost:9999 (127.0.0.1). - connect (111: Connection refused)

suggests that your system is configured to use a local HTTP proxy for apt connections (and that no such proxy is running).

You can temporarily override this setting on the command line by passing an empty value Acquire::Http::Proxy= on the command line e.g.

sudo apt-get -oAcquire::Http::Proxy= update

If that works and you believe that the proxy configuration is inappropriate, then you can make the setting persistent by locating and either commenting out or removing any lines related to proxy configurations in your apt configuration files - /etc/apt/apt.conf and associated files in the /etc/apt/apt.conf.d/ directory - as well as an entry for HTTP you may find entries for HTTPS and/or socks protocols.

1
  • 1
    The empty-proxy trick didn't work for me, but I was able to solve the proxy problem by going into All settings/Network/Network Proxy and clicking "Apply system wide".
    – MikaelF
    Aug 21, 2019 at 3:32

You must log in to answer this question.

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