我正在 Windows 10 上以 WSL2 安装的形式运行 Ubuntu Focal。
看来我的 Ubuntu 安装无法下载任何文件。我已使用一个简单的wget
命令进行了说明,但情况阻止了sudo apt update
任何其他系统更新。
ping
正在返回预期结果。
主机 Windows 系统正常运行,并能够显示wget
无法获取的文件。如下图所示
以下是一个示例会话:
$ lsb_release -d
Description: Ubuntu 20.04.3 LTS
$ uname -r
5.4.72-microsoft-standard-WSL2
$ wget https://raw.githubusercontent.com/WesPeacock/SampleSFM/master/README.md
--2021-10-02 20:30:05-- https://raw.githubusercontent.com/WesPeacock/SampleSFM/master/README.md
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.110.133, 185.199.109.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... failed: Connection timed out.
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.110.133|:443... ^C
$ ping raw.githubusercontent.com
PING raw.githubusercontent.com (185.199.111.133) 56(84) bytes of data.
64 bytes from cdn-185-199-111-133.github.com (185.199.111.133): icmp_seq=1 ttl=59 time=21.0 ms
64 bytes from cdn-185-199-111-133.github.com (185.199.111.133): icmp_seq=2 ttl=59 time=22.8 ms
64 bytes from cdn-185-199-111-133.github.com (185.199.111.133): icmp_seq=3 ttl=59 time=22.2 ms
64 bytes from cdn-185-199-111-133.github.com (185.199.111.133): icmp_seq=4 ttl=59 time=22.1 ms
^C
--- raw.githubusercontent.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 21.047/22.023/22.798/0.627 ms
答案1
问题是 Windows 防病毒软件防火墙将本地网络设置为不受信任。