• 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

    在更新就没有错误了。

  • 相关阅读:
    java1.8 ConcurrentHashMap 详细理解
    java 常见高级开发面试题 非算法等特定岗 一
    java.util.concurrent各组件分析 一 sun.misc.Unsafe
    分布式锁 并发 自旋 优化 二
    分布式锁 并发 自旋 优化
    TreeMap 原理
    java8 LinkedHashMap 原理
    SpringBoot启动zipkin-server报错Error creating bean with name ‘armeriaServer’ defined in class path resource
    spring cloud启动zipkin,报错maven依赖jar包冲突 Class path contains multiple SLF4J bindings
    springboot2.0 management.security.enabled无效
  • 原文地址:https://www.cnblogs.com/litifeng/p/14829865.html
Copyright © 2020-2023  润新知