ubuntu apt-get update 出错 Could not connect to 192.168.8.1:3128 (192.168.8.1).

今天在ubuntu上执行sudo apt-get update 时,出现了下面的错误:

Err:1 http://archive.ubuntu.com/ubuntu bionic InRelease
  Could not connect to 192.168.8.1:3128 (192.168.8.1). - connect (111: Connection refused)
Err:2 http://ppa.launchpad.net/alex-p/tesseract-ocr/ubuntu bionic InRelease
  Could not connect to 192.168.8.1:3128 (192.168.8.1). - connect (111: Connection refused)
Err:3 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic InRelease
  Unable to connect to 192.168.8.1:3128:
Err:4 http://dl.google.com/linux/chrome-remote-desktop/deb stable InRelease
  Could not connect to 192.168.8.1:3128 (192.168.8.1). - connect (111: Connection refused)
Err:5 http://mirrors.ustc.edu.cn/ros/ubuntu bionic InRelease
  Could not connect to 192.168.8.1:3128 (192.168.8.1). - connect (111: Connection refused)
Err:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease                       
  Unable to connect to 192.168.8.1:3128:
Err:7 http://archive.ubuntu.com/ubuntu bionic-backports InRelease                     
  Unable to connect to 192.168.8.1:3128:
Err:8 http://archive.ubuntu.com/ubuntu bionic-security InRelease                      
  Unable to connect to 192.168.8.1:3128:
Err:9 http://security.ubuntu.com/ubuntu xenial-security InRelease                     
  Could not connect to 192.168.8.1:3128 (192.168.8.1). - connect (111: Connection refused)
Err:10 http://ppa.launchpad.net/fossfreedom/indicator-sysmonitor/ubuntu bionic InRelease
  Unable to connect to 192.168.8.1:3128:
Err:11 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease          
  Unable to connect to 192.168.8.1:3128:
Err:12 http://ppa.launchpad.net/nanoshot/ppa/ubuntu bionic InRelease                  
  Unable to connect to 192.168.8.1:3128:
Err:13 http://ppa.launchpad.net/shutter/ppa/ubuntu bionic InRelease                   
  Unable to connect to 192.168.8.1:3128:
Err:14 http://ppa.launchpad.net/xorg-edgers/ppa/ubuntu bionic InRelease               
  Unable to connect to 192.168.8.1:3128:
Err:15 http://www.scootersoftware.com bcompare4 InRelease                             
  Could not connect to 192.168.8.1:3128 (192.168.8.1). - connect (111: Connection refused)
Err:16 https://linux.teamviewer.com/deb stable InRelease                              
  Could not connect to 192.168.8.1:3128 (192.168.8.1). - connect (111: Connection refused)
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Could not connect to 192.168.8.1:3128 (192.168.8.1). - connect (111: Connection refused)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Unable to connect to 192.168.8.1:3128:
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease  Unable to connect to 192.168.8.1:3128:
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Unable to connect to 192.168.8.1:3128:
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Could not connect to 192.168.8.1:3128 (192.168.8.1). - connect (111: Connection refused)
W: Failed to fetch http://ppa.launchpad.net/alex-p/tesseract-ocr/ubuntu/dists/bionic/InRelease  Could not connect to 192.168.8.1:3128 (192.168.8.1). - connect (111: Connection refused)
W: Failed to fetch http://dl.google.com/linux/chrome-remote-desktop/deb/dists/stable/InRelease  Could not connect to 192.168.8.1:3128 (192.168.8.1). - connect (111: Connection refused)
W: Failed to fetch http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu/dists/bionic/InRelease  Unable to connect to 192.168.8.1:3128:
W: Failed to fetch http://ppa.launchpad.net/fossfreedom/indicator-sysmonitor/ubuntu/dists/bionic/InRelease  Unable to connect to 192.168.8.1:3128:
W: Failed to fetch http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu/dists/bionic/InRelease  Unable to connect to 192.168.8.1:3128:
W: Failed to fetch http://ppa.launchpad.net/nanoshot/ppa/ubuntu/dists/bionic/InRelease  Unable to connect to 192.168.8.1:3128:
W: Failed to fetch http://mirrors.ustc.edu.cn/ros/ubuntu/dists/bionic/InRelease  Could not connect to 192.168.8.1:3128 (192.168.8.1). - connect (111: Connection refused)
W: Failed to fetch http://www.scootersoftware.com/dists/bcompare4/InRelease  Could not connect to 192.168.8.1:3128 (192.168.8.1). - connect (111: Connection refused)
W: Failed to fetch http://ppa.launchpad.net/shutter/ppa/ubuntu/dists/bionic/InRelease  Unable to connect to 192.168.8.1:3128:
W: Failed to fetch https://linux.teamviewer.com/deb/dists/stable/InRelease  Could not connect to 192.168.8.1:3128 (192.168.8.1). - connect (111: Connection refused)
W: Failed to fetch http://ppa.launchpad.net/xorg-edgers/ppa/ubuntu/dists/bionic/InRelease  Unable to connect to 192.168.8.1:3128:
W: Some index files failed to download. They have been ignored, or old ones used instead.

按照网上的方法,尝试过很多中方案,都没有解决,后来发现是在配置文件中设置了代理所致。解决办法:

cd /etc/apt/
# 将apt.conf文件中内容清空即可
echo >apt.conf

然后执行sudo apt-get update即可成功更新。

参考链接:
https://askubuntu.com/questions/773421/sudo-apt-get-update-not-working-unable-to-connect-to-192-168-1-2543128

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
"Could not connect to '192.168.200.88' (port 22): Connection failed" 错误信息表明无法连接到主机的22端口。这通常是由于SSH服务器没有正确配置或未启动引起的。要解决此问题,可以按照以下步骤进行操作: 1. 确保目标主机的SSH服务器已安装并正在运行。您可以通过在目标主机上执行命令`ps -ef | grep ssh`来检查是否有SSH进程正在运行。 2. 如果只有客户端安装了SSH,而服务器端还没有安装,则需要在服务器上安装SSH服务器。在Ubuntu上,您可以使用以下命令安装openssh-server:`sudo apt-get install openssh-server`。请注意,在安装完成后,SSH服务器将自动启动并监听默认的22端口。 3. 如果服务器上已安装了SSH服务器,并且您仍然无法连接,请确保防火墙没有阻止SSH连接。您可以通过在目标主机上执行以下命令来检查防火墙设置:`sudo ufw status`。如果防火墙处于活动状态并且已启用默认规则,则需要允许SSH流量通过防火墙。例如,使用以下命令允许SSH流量:`sudo ufw allow ssh`。 4. 如果您仍然无法连接到目标主机,请确保您所使用的IP地址和端口号是正确的,并且目标主机是可访问的。您可以尝试使用`ping`命令来检查目标主机的可用性。 总结起来,要解决“Could not connect to '192.168.200.88' (port 22): Connection failed”错误,您需要确保目标主机已安装并运行SSH服务器,防火墙没有阻止SSH连接,并且您提供的IP地址和端口号是正确的。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [使用Xshell连接linux的虚拟机出现Could not connect to ‘192.168.64.128‘ (port 22):Connection failed....](https://blog.csdn.net/weixin_46005650/article/details/121832544)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *3* [Ubuntu18.04下解决Qt出现qt.qpa.plugin:Could not load the Qt platform plugin “xcb“问题](https://download.csdn.net/download/weixin_38695061/12841039)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值