我已经在新的 VirtualBox 6.10 映像中安装了 debian10,并且正在尝试 wget ruby,但收到此错误;
wget -d http://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.1.tar.bz2
DEBUG output created by Wget 1.20.1 on linux-gnu.
Reading HSTS entries from /home/deploy/.wget-hsts
URI encoding = ‘UTF-8’
Converted file name 'ruby-2.7.1.tar.bz2' (UTF-8) -> 'ruby-2.7.1.tar.bz2' (UTF-8)
--2020-06-20 21:47:58-- http://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.1.tar.bz2
Resolving cache.ruby-lang.org (cache.ruby-lang.org)... 151.101.81.178, 2a04:4e42:13::434
Caching cache.ruby-lang.org => 151.101.81.178 2a04:4e42:13::434
Connecting to cache.ruby-lang.org (cache.ruby-lang.org)|151.101.81.178|:80... connected.
Created socket 3.
Releasing 0x0000559037039410 (new refcount 1).
---request begin---
GET /pub/ruby/2.7/ruby-2.7.1.tar.bz2 HTTP/1.1
User-Agent: Wget/1.20.1 (linux-gnu)
Accept: */*
Accept-Encoding: identity
Host: cache.ruby-lang.org
Connection: Keep-Alive
---request end---
HTTP request sent, awaiting response...
---response begin---
HTTP/1.1 200 OK
x-amz-id-2: jNncZWwFSDNpAZf7MTPbl/5NjaQmHfLVkliz9EUFtmiU0znHJZ1qjhP120rm83pSsoyEMYsD2Bw=
x-amz-request-id: 452C95AE7903C760
Last-Modified: Tue, 31 Mar 2020 13:12:51 GMT
ETag: "2e18bd214b76d0bcf9781c9d212f27c6-2"
x-amz-version-id: zx1AE1dmawAEA16qs3I7uHPSp0Go.dHL
Content-Type: application/x-tar
Server: AmazonS3
Accept-Ranges: bytes
Age: 290579
Content-Length: 14684616
Accept-Ranges: bytes
Date: Sat, 20 Jun 2020 11:47:58 GMT
Via: 1.1 varnish
Connection: keep-alive
X-Served-By: cache-mel19025-MEL
X-Cache: HIT
X-Cache-Hits: 0
X-Timer: S1592653679.667345,VS0,VE3
---response end---
200 OK
Registered socket 3 for persistent reuse.
Length: 14684616 (14M) [application/x-tar]
Saving to: ‘ruby-2.7.1.tar.bz2.2’
ruby-2.7.1.tar.bz2.2 0%[ ] 0 --.-KB/s
它就坐在那里。如果我尝试在主机上使用完全相同的命令下载,它每次都会有效。
更新
将虚拟机的网络从 Bridge 更改为 NAT 我可以在虚拟机中正常运行 wget 命令。
一定和这座桥有关系。
我一直使用的桥接设置是;
Attached to: Bridged Adapter
Name: enx8cae4ce92c47 (usb to NIC adapter)
Adapter Type: PCnet-FAST III (Am79C973)
Promiscuous Mode: Deny
Cable Connected: true