• 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基础知识(一)环境变量的设置、变量与常量、自动类型转换、自增长、赋值运算符
    ModelState
    DOM
    正则表达式常见形式
    通过JS设置一个元素的文本
    JS(三) 原型对象与原型链
    JS(二)call方法和apply方法
    第四周学习进度表
    敏捷开发方法综述
    数组02
  • 原文地址:https://www.cnblogs.com/litifeng/p/14829865.html
Copyright © 2020-2023  润新知