Connecting to github.com (github.com)|20.205.243.166|:44

failed: Connection timed out.

c 复制代码
wqbboy@wqbboy:/opt/mails$ wget https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
--2025-09-06 10:30:52--  https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
Resolving github.com (github.com)... 20.205.243.166
Connecting to github.com (github.com)|20.205.243.166|:443... connected.
HTTP request sent, awaiting response... No data received.
Retrying.

--2025-09-06 10:32:55--  (try: 2)  https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
Connecting to github.com (github.com)|20.205.243.166|:443...
failed: Connection timed out.
Resolving github.com (github.com)... 20.205.243.166
Connecting to github.com (github.com)|20.205.243.166|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/iredmail/iRedMail/tar.gz/refs/tags/1.7.4 [following]
--2025-09-06 10:35:38--  https://codeload.github.com/iredmail/iRedMail/tar.gz/refs/tags/1.7.4
Resolving codeload.github.com (codeload.github.com)... 20.205.243.165
Connecting to codeload.github.com (codeload.github.com)|20.205.243.165|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 250725 (245K) [application/x-gzip]
1.7.4.tar.gz: Permission denied

Cannot write to '1.7.4.tar.gz' (Success).
wqbboy@wqbboy:/opt/mails$
wqbboy@wqbboy:/opt/mails$ ls

下面针对Ubuntu编译 Buildroot 时无法从 github 上下载各种 tar.gz 问题进行解决。

首先,我的Windows10是打开梯子的,可以看到系统代理端口信息如下:(注意!!!这里即使没有梯子也不会影响到后续的步骤,只是无法在浏览器中打开github相关的网页而已,这点并不影响)

点击如下链接GitHub.com - GitHub: Let's build from here · GitHub (ipaddress.com)查看github.com这个域名对应的IP地址,如下IP地址为140.82.114.3

Ubuntu虚拟机下关闭代理:

.

Ubuntu命令行下配置 git 不使用代理:

c 复制代码
sudo git config --global --   unset http.proxy
sudo git config --global --   unset https.proxy

将上面 github.com域名等效的IP地址配进我们的Ubuntu虚拟机 /etc/hosts文件中:

ping github.com

c 复制代码
wqbboy@wqbboy:/opt/mails$ ping codeload.github.com
PING codeload.github.com (20.205.243.165) 56(84) bytes of data.
64 bytes from 20.205.243.165 (20.205.243.165): icmp_seq=1 ttl=111 time=182 ms
64 bytes from 20.205.243.165 (20.205.243.165): icmp_seq=2 ttl=111 time=71.3 ms
64 bytes from 20.205.243.165 (20.205.243.165): icmp_seq=3 ttl=111 time=70.6 ms
64 bytes from 20.205.243.165 (20.205.243.165): icmp_seq=4 ttl=111 time=70.8 ms
^C
--- codeload.github.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3035ms
rtt min/avg/max/mdev = 70.579/98.771/182.413/48.291 ms
wqbboy@wqbboy:/opt/mails$ wget http://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
URL transformed to HTTPS due to an HSTS policy
--2025-09-06 10:36:16--  https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
Resolving github.com (github.com)... 20.205.243.166
Connecting to github.com (github.com)|20.205.243.166|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/iredmail/iRedMail/tar.gz/refs/tags/1.7.4 [following]
--2025-09-06 10:36:32--  https://codeload.github.com/iredmail/iRedMail/tar.gz/refs/tags/1.7.4
Resolving codeload.github.com (codeload.github.com)... 20.205.243.165
Connecting to codeload.github.com (codeload.github.com)|20.205.243.165|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
1.7.4.tar.gz: Permission denied

Cannot write to '1.7.4.tar.gz' (Success).

在这里插入代码片

c 复制代码
wqbboy@wqbboy:/opt/mails$ wget https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
--2025-09-06 10:37:03--  https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
Resolving github.com (github.com)... 20.205.243.166
Connecting to github.com (github.com)|20.205.243.166|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/iredmail/iRedMail/tar.gz/refs/tags/1.7.4 [following]
--2025-09-06 10:37:04--  https://codeload.github.com/iredmail/iRedMail/tar.gz/refs/tags/1.7.4
Resolving codeload.github.com (codeload.github.com)... 20.205.243.165
Connecting to codeload.github.com (codeload.github.com)|20.205.243.165|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 250725 (245K) [application/x-gzip]
1.7.4.tar.gz: Permission denied

Cannot write to '1.7.4.tar.gz' (Success).
wqbboy@wqbboy:/opt/mails$ ^C
wqbboy@wqbboy:/opt/mails$ Connecting to github.com (github.com)Connecting to github.com (github.com)
-bash: syntax error near unexpected token `('
wqbboy@wqbboy:/opt/mails$ sudo yum update nss
sudo: yum: command not found
wqbboy@wqbboy:/opt/mails$ sudo apt-get update nss
E: The update command takes no arguments
wqbboy@wqbboy:/opt/mails$ sudo apt-get update
Hit:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy InRelease
Hit:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates InRelease
Hit:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu jammy-security InRelease
Reading package lists... Done
wqbboy@wqbboy:/opt/mails$ wget https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
--2025-09-06 10:38:51--  https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
Resolving github.com (github.com)... 20.205.243.166
Connecting to github.com (github.com)|20.205.243.166|:443... connected.
HTTP request sent, awaiting response... No data received.
Retrying.

--2025-09-06 10:40:22--  (try: 2)  https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
Connecting to github.com (github.com)|20.205.243.166|:443... connected.
HTTP request sent, awaiting response... No data received.
Retrying.

--2025-09-06 10:40:45--  (try: 3)  https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
Connecting to github.com (github.com)|20.205.243.166|:443... failed: Connection timed out.
Resolving github.com (github.com)... 20.205.243.166
Connecting to github.com (github.com)|20.205.243.166|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/iredmail/iRedMail/tar.gz/refs/tags/1.7.4 [following]
--2025-09-06 10:44:01--  https://codeload.github.com/iredmail/iRedMail/tar.gz/refs/tags/1.7.4
Resolving codeload.github.com (codeload.github.com)... 20.205.243.165
Connecting to codeload.github.com (codeload.github.com)|20.205.243.165|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 250725 (245K) [application/x-gzip]
1.7.4.tar.gz: Permission denied

Cannot write to '1.7.4.tar.gz' (Success).

修改hosts,

Ubuntu 下检查此时 github.com 网络是否可达:

c 复制代码
wqbboy@wqbboy:/opt/mails$ sudo vi /etc/hosts
wqbboy@wqbboy:/opt/mails$ sudo vi /etc/hosts

wqbboy@wqbboy:/opt/mails$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 wqbboy.domain.com  wqbboy

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
140.82.112.3  github.com
151.101.1.194 github.global.ssl.fastly.net

wqbboy@wqbboy:/opt/mails$ wget https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
--2025-09-06 10:48:50--  https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
Resolving github.com (github.com)... 140.82.112.3
Connecting to github.com (github.com)|140.82.112.3|:443... connected.
HTTP request sent, awaiting response... No data received.
Retrying.

--2025-09-06 10:50:21--  (try: 2)  https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
Connecting to github.com (github.com)|140.82.112.3|:443... connected.
HTTP request sent, awaiting response... No data received.
Retrying.

--2025-09-06 10:52:09--  (try: 3)  https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
Connecting to github.com (github.com)|140.82.112.3|:443... failed: Connection timed out.
Resolving github.com (github.com)... 140.82.112.3
Connecting to github.com (github.com)|140.82.112.3|:443... ^[[A

重新执行

c 复制代码
wqbboy@wqbboy:/opt/mails$ wget https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
--2025-09-06 10:54:29--  https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
Resolving github.com (github.com)... 140.82.112.3
Connecting to github.com (github.com)|140.82.112.3|:443... ^C
wqbboy@wqbboy:/opt/mails$ sudo git config --global -- unset http.proxy
error: key does not contain a section: unset
wqbboy@wqbboy:/opt/mails$ sudo git config --global -- unset https.proxy
error: key does not contain a section: unset
wqbboy@wqbboy:/opt/mails$ sudo git config --global  --unset http.proxy
wqbboy@wqbboy:/opt/mails$ sudo git config --global  --unset https.proxy
wqbboy@wqbboy:/opt/mails$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 wqbboy.domain.com  wqbboy

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
140.82.112.3  github.com
151.101.1.194 github.global.ssl.fastly.net
wqbboy@wqbboy:/opt/mails$ ping github.com
PING github.com (140.82.112.3) 56(84) bytes of data.
64 bytes from github.com (140.82.112.3): icmp_seq=1 ttl=46 time=271 ms
64 bytes from github.com (140.82.112.3): icmp_seq=2 ttl=46 time=269 ms
64 bytes from github.com (140.82.112.3): icmp_seq=3 ttl=46 time=270 ms
64 bytes from github.com (140.82.112.3): icmp_seq=5 ttl=46 time=269 ms
^C
--- github.com ping statistics ---
6 packets transmitted, 4 received, 33.3333% packet loss, time 5036ms
rtt min/avg/max/mdev = 268.931/269.738/270.906/0.723 ms
wqbboy@wqbboy:/opt/mails$ wget https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
--2025-09-06 10:56:59--  https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
Resolving github.com (github.com)... 140.82.112.3
Connecting to github.com (github.com)|140.82.112.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/iredmail/iRedMail/tar.gz/refs/tags/1.7.4 [following]
--2025-09-06 10:57:00--  https://codeload.github.com/iredmail/iRedMail/tar.gz/refs/tags/1.7.4
Resolving codeload.github.com (codeload.github.com)... 20.205.243.165
Connecting to codeload.github.com (codeload.github.com)|20.205.243.165|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
1.7.4.tar.gz: Permission denied

Cannot write to '1.7.4.tar.gz' (Success).
wqbboy@wqbboy:/opt/mails$ ls
wqbboy@wqbboy:/opt/mails$ wget https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
--2025-09-06 10:57:10--  https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
Resolving github.com (github.com)... 140.82.112.3
Connecting to github.com (github.com)|140.82.112.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/iredmail/iRedMail/tar.gz/refs/tags/1.7.4 [following]
--2025-09-06 10:57:11--  https://codeload.github.com/iredmail/iRedMail/tar.gz/refs/tags/1.7.4
Resolving codeload.github.com (codeload.github.com)... 20.205.243.165
Connecting to codeload.github.com (codeload.github.com)|20.205.243.165|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 250725 (245K) [application/x-gzip]
1.7.4.tar.gz: Permission denied

Cannot write to '1.7.4.tar.gz' (Success).
wqbboy@wqbboy:/opt/mails$ wget http://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
URL transformed to HTTPS due to an HSTS policy
--2025-09-06 10:57:26--  https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
Resolving github.com (github.com)... 140.82.112.3
Connecting to github.com (github.com)|140.82.112.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/iredmail/iRedMail/tar.gz/refs/tags/1.7.4 [following]
--2025-09-06 10:57:28--  https://codeload.github.com/iredmail/iRedMail/tar.gz/refs/tags/1.7.4
Resolving codeload.github.com (codeload.github.com)... 20.205.243.165
Connecting to codeload.github.com (codeload.github.com)|20.205.243.165|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 250725 (245K) [application/x-gzip]
1.7.4.tar.gz: Permission denied

Cannot write to '1.7.4.tar.gz' (Success).

加上sudo

c 复制代码
wqbboy@wqbboy:/opt/mails$ sodu wget http://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
sodu: command not found
wqbboy@wqbboy:/opt/mails$ sudo wget http://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
--2025-09-06 10:58:17--  http://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
Resolving github.com (github.com)... 140.82.112.3
Connecting to github.com (github.com)|140.82.112.3|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz [following]
--2025-09-06 10:58:18--  https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
Connecting to github.com (github.com)|140.82.112.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/iredmail/iRedMail/tar.gz/refs/tags/1.7.4 [following]
--2025-09-06 10:58:19--  https://codeload.github.com/iredmail/iRedMail/tar.gz/refs/tags/1.7.4
Resolving codeload.github.com (codeload.github.com)... 20.205.243.165
Connecting to codeload.github.com (codeload.github.com)|20.205.243.165|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: '1.7.4.tar.gz'

1.7.4.tar.gz            [  <=>               ] 244.85K   840KB/s    in 0.3s

2025-09-06 10:58:20 (840 KB/s) - '1.7.4.tar.gz' saved [250725]

wqbboy@wqbboy:/opt/mails$ ls
1.7.4.tar.gz
wqbboy@wqbboy:/opt/mails$
相关推荐
草梅友仁9 小时前
草梅 Auth 1.6.0 发布密码强度组件 Twilio 短信支持 | 2025 年第 36 周草梅周报
前端·开源·github
CoderJia程序员甲10 小时前
GitHub 热榜项目 - 日榜(2025-09-03)
ai·开源·github·开源项目·github热榜
我是哪吒12 小时前
分布式微服务系统架构第170集:Kafka消费者并发-多节点消费-可扩展性
后端·面试·github
GitLqr13 小时前
AI洞察 | Hunyuan-MT 翻译模型开源,谷歌终端嵌入模型登场
github·ai编程·gemini
杨杨杨大侠14 小时前
第2章:设计核心接口和事件模型
java·github·eventbus
杨杨杨大侠14 小时前
第1章:事件驱动框架基础概念
java·github·eventbus
2501_9301247019 小时前
编辑shell脚本示例练习
linux·服务器·github
绝无仅有20 小时前
三方系统callback回调MySQL 报错排查与解决:mysql context cancel
后端·面试·github
绝无仅有20 小时前
项目三方合同提交失败的MySQL 错误排查与解决:`context deadline exceeded`
后端·面试·github