sudo apt-get update:无法连接到localhost:9999(127.0.0.1)。 – 连接(111:拒绝连接)

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:我不知道堆栈交换文化。 当我在electronics.stackexchange.com上发布同样的问题时,我被5投了票,因为这是来自turtlebot3-burgerbot的一个问题。 无论如何,我是Linux领域的新手并且急于寻找答案。 谢谢。

错误

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

建议您的系统配置为使用本地HTTP代理进行apt连接(并且没有运行此类代理)。

您可以通过在命令行上传递空值Acquire::Http::Proxy=来临时覆盖命令行上的此设置

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

如果这样做并且您认为代理配置不合适 ,那么您可以通过在apt配置文件中查找或删除与代理配置相关的任何行来定期设置 – /etc/apt/apt.conf并关联/etc/apt/apt.conf.d/目录中的/etc/apt/apt.conf.d/ – 以及HTTP条目,您可以找到HTTPS和/或socks协议的条目。