zoukankan      html  css  js  c++  java
  • wsl中debian无法连接到源

    使用wsl中的debian10更新时,出现如下错误:

    admin@DESKTOP:~$ sudo apt update
    Err:1 http://deb.debian.org/debian buster InRelease
      Could not connect to debian.map.fastlydns.net:80 (127.167.1.230). - connect (111: Connection refused) Cannot initiate the connection to debian.map.fastlydns.net:80 (fd00:696e:6974:6578::4f:1e7). - connect (101: Network is unreachable) Could not connect to deb.debian.org:80 (127.167.1.232). - connect (111: Connection refused) Cannot initiate the connection to deb.debian.org:80 (fd00:696e:6974:6578::4f:1e9). - connect (101: Network is unreachable)
    Err:2 http://deb.debian.org/debian buster-updates InRelease
      Cannot initiate the connection to deb.debian.org:80 (fd00:696e:6974:6578::4f:1e9). - connect (101: Network is unreachable)
    Err:3 http://ftp.debian.org/debian buster-backports InRelease
      Could not connect to debian.map.fastlydns.net:80 (127.167.1.230). - connect (111: Connection refused) Cannot initiate the connection to debian.map.fastlydns.net:80 (fd00:696e:6974:6578::4f:1e7). - connect (101: Network is unreachable) Could not connect to ftp.debian.org:80 (127.167.2.112). - connect (111: Connection refused) Cannot initiate the connection
    # This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /eto ftp.debian.org:80 (fd00:696e:6974:6578::4f:271). - connect (101: Network is unreachable)
    Err:4 http://security.debian.org/debian-security buster/updates InRelease
      Could not connect to debian.map.fastlydns.net:80 (127.167.1.230). - connect (111: Connection refused) Cannot initiate the connection to debian.map.fastlydns.net:80 (fd00:696e:6974:6578::4f:1e7). - connect (101: Network is unreachable) Could not connect to security.debian.org:80 (127.167.1.234). - connect (111: Connection refused) Cannot initiate the connection to security.debian.org:80 (fd00:696e:6974:6578::4f:1eb). - connect (101: Network is unreachable)
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    All packages are up to date.
    W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  Could not connect to debian.map.fastlydns.net:80 (127.167.1.230). - connect (111: Connection refused) Cannot initiate the connection to debian.map.fastlydns.net:80 (fd00:696e:6974:6578::4f:1e7). - connect (101: Network is unreachable) Could not connect to deb.debian.org:80 (127.167.1.232). - connect (111: Connection refused) Cannot initiate the connection to deb.debian.org:80 (fd00:696e:6974:6578::4f:1e9). - connect (101: Network is unreachable)
    W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  Cannot initiate the connection to deb.debian.org:80 (fd00:696e:6974:6578::4f:1e9). - connect (101: Network is unreachable)
    W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  Could not connect to debian.map.fastlydns.net:80 (127.167.1.230). - connect (111: Connection refused) Cannot initiate the connection to debian.map.fastlydns.net:80 (fd00:696e:6974:6578::4f:1e7). - connect (101: Network is unreachable) Could not connect to security.debian.org:80 (127.167.1.234). - connect (111: Connection refused) Cannot initiate the connection to security.debian.org:80 (fd00:696e:6974:6578::4f:1eb). - connect (101: Network is unreachable)
    W: Failed to fetch http://ftp.debian.org/debian/dists/buster-backports/InRelease  Could not connect to debian.map.fastlydns.net:80 (127.167.1.230). - connect (111: Connection refused) Cannot initiate the connection to debian.map.fastlydns.net:80 (fd00:696e:6974:6578::4f:1e7). - connect (101: Network is unreachable) Could not connect to ftp.debian.org:80 (127.167.2.112). - connect (111: Connection refused) Cannot initiate the connection to ftp.debian.org:80 (fd00:696e:6974:6578::4f:271). - connect (101: Network is unreachable)
    W: Some index files failed to download. They have been ignored, or old ones used instead.

    经过一番查询和乱搞下,发现修改dns服务器后就好了

    sudo vi /etc/resolv.conf

    把nameserver换成 8.8.8.8 和 8.8.4.4

    在重新启动一下网络:

    sudo /etc/init.d/networking restart

    在更新就没有错误了。

  • 相关阅读:
    Java基础学习总结(33)——Java8 十大新特性详解
    Java基础学习总结(33)——Java8 十大新特性详解
    RabbitMQ学习总结(6)——消息的路由分发机制详解
    RabbitMQ学习总结(6)——消息的路由分发机制详解
    Stanford公开课《编译原理》学习笔记(1~4课)
    补习系列(21)-SpringBoot初始化之7招式
    使用modelarts部署bert命名实体识别模型
    全面认识 RUST -- 掌控未来的雷电
    补习系列(20)-大话 WebSocket 与 "尬聊"的实现
    【开发者portal在线开发插件系列二】多条上下行消息(messageId的使用)
  • 原文地址:https://www.cnblogs.com/litifeng/p/14829865.html
Copyright © 2011-2022 走看看