执行apt-get update返回Failed to fetch ".../trusty/Release"

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 执行apt-get update返回Failed to fetch ".../trusty/Release"

#16

帖子 poloshiao » 2015-11-17 16:20

Err http://extras.ubuntu.com trusty InRelease
Err http://extras.ubuntu.com trusty Release.gpg
Cannot initiate the connection to extras.ubuntu.com:80 (2001:67c:1360:8c01::23). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::23 80]
W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/t ... elease.gpg Cannot initiate the connection to extras.ubuntu.com:80 (2001:67c:1360:8c01::23). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::23 80]
1. http://extras.ubuntu.com 可能頻寬不夠或網路不穩 常常連不上 以至於 更新時出現錯誤訊息
1-0. 暫時解決方案 就是把它 disable 等一段時候 再 enable
1-0-1. disable 時來自該套件庫的套件 只是暫時性不更新 一般不會有何不良影響
1-1. sudo cat /etc/apt/sources.list | grep extra
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main
1-1-1. disable
# deb http://extras.ubuntu.com/ubuntu trusty main
# deb-src http://extras.ubuntu.com/ubuntu trusty main
1-2. enable
把 # 移除
2. 記得 更改後 要執行
sudo apt-get update
Err http://extras.ubuntu.com trusty InRelease
Err http://extras.ubuntu.com trusty Release.gpg
Cannot initiate the connection to extras.ubuntu.com:80 (2001:67c:1360:8c01::23). - connect (101: Network is unreachable) [IP: Cannot initiate the connection to extras.ubuntu.com:80 (2001:67c:1360:8c01::23). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::23 80]
Cannot initiate the connection to us.archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) [IP: 2001:67c:1562::15 80]
Err http://us.archive.ubuntu.com trusty-updates Release.gpg
Cannot initiate the connection to us.archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) [IP: 2001:67c:1562::15 80]
Err http://us.archive.ubuntu.com trusty-backports Release.gpg
Cannot initiate the connection to us.archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) [IP: 2001:67c:1562::15 80]
Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8c01::19). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::19 80]
W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/t ... elease.gpg Cannot initiate the connection to extras.ubuntu.com:80 (2001:67c:1360:8c01::23). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::23 80]
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dis ... elease.gpg Cannot initiate the connection to us.archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) [IP: 2001:67c:1562::15 80]
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dis ... elease.gpg Cannot initiate the connection to us.archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) [IP: 2001:67c:1562::15 80]
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dis ... elease.gpg Cannot initiate the connection to us.archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) [IP: 2001:67c:1562::15 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists ... elease.gpg Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8c01::19). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::19 80]
3. 你的 domain name 都解析成 IPV6 但是 你的網路無法到達
extras.ubuntu.com:80 (2001:67c:1360:8c01::23)
us.archive.ubuntu.com:80 (2001:67c:1562::15)
security.ubuntu.com:80 (2001:67c:1360:8c01::19)
3-1. 把下面指令 複製 貼進終端機 執行
3-1-1. sudo ping -c 3 127.0.0.1
3-1-2. sudo ping6 -c 3 ::1
3-1-3. sudo ping -c 3 forum.ubuntu.org.cn
3-1-4. sudo ping6 -c 3 forum.ubuntu.org.cn
把結果直接 選取/複製 貼上來
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 执行apt-get update返回Failed to fetch ".../trusty/Release"

#17

帖子 vickycq » 2015-11-17 16:29

Err http://us.archive.ubuntu.com trusty Release.gpg
Cannot initiate the connection to us.archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) [IP: 2001:67c:1562::15 80]
1.
根据自己所处位置,合理选择镜像源。

2.
确认是否可以连接 ipv6 网络?
有可能未开通 ipv6,但由于运营商的设置导致试图使用 ipv6
可以强制 apt-get 使用 ipv4:

代码: 全选

apt-get -o Acquire::ForceIPv4=true update
如果确实是此问题,可创建文件 /etc/apt/apt.conf.d/99force-ipv4 加入:

代码: 全选

Acquire::ForceIPv4 "true";
参考
https://www.vultr.com/docs/force-apt-ge ... -or-debian
http://unix.stackexchange.com/questions ... pv6-method
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
nangui.hu
帖子: 11
注册时间: 2015-11-17 10:41
系统: ubuntu14.04

Re: 执行apt-get update返回Failed to fetch ".../trusty/Release"

#18

帖子 nangui.hu » 2015-11-17 16:37

poloshiao 写了:
Err <!-- m --><a class="postlink" href="http://extras.ubuntu.com">http://extras.ubuntu.com</a><!-- m --> trusty InRelease
Err <!-- m --><a class="postlink" href="http://extras.ubuntu.com">http://extras.ubuntu.com</a><!-- m --> trusty Release.gpg
Cannot initiate the connection to extras.ubuntu.com:80 (2001:67c:1360:8c01::23). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::23 80]
W: Failed to fetch <!-- m --><a class="postlink" href="http://extras.ubuntu.com/ubuntu/dists/t ... dists/t</a><!-- m --> ... elease.gpg Cannot initiate the connection to extras.ubuntu.com:80 (2001:67c:1360:8c01::23). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::23 80]
1. <!-- m --><a class="postlink" href="http://extras.ubuntu.com">http://extras.ubuntu.com</a><!-- m --> 可能頻寬不夠或網路不穩 常常連不上 以至於 更新時出現錯誤訊息
1-0. 暫時解決方案 就是把它 disable 等一段時候 再 enable
1-0-1. disable 時來自該套件庫的套件 只是暫時性不更新 一般不會有何不良影響
1-1. sudo cat /etc/apt/sources.list | grep extra
deb <!-- m --><a class="postlink" href="http://extras.ubuntu.com/ubuntu">http:/ ... /ubuntu</a><!-- m --> trusty main
deb-src <!-- m --><a class="postlink" href="http://extras.ubuntu.com/ubuntu">http:/ ... /ubuntu</a><!-- m --> trusty main
1-1-1. disable
# deb <!-- m --><a class="postlink" href="http://extras.ubuntu.com/ubuntu">http:/ ... /ubuntu</a><!-- m --> trusty main
# deb-src <!-- m --><a class="postlink" href="http://extras.ubuntu.com/ubuntu">http:/ ... /ubuntu</a><!-- m --> trusty main
1-2. enable
把 # 移除
2. 記得 更改後 要執行
sudo apt-get update
我照着上面的步骤做了,再执行了一次sudo apt-get update,还是在报同样的错误,这种问题是和网络有关而不是和配置有关吗?我对Ubuntu是初学,还请指教!谢谢你及时的回复!
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 执行apt-get update返回Failed to fetch ".../trusty/Release"

#19

帖子 poloshiao » 2015-11-17 16:50

我照着上面的步骤做了,再执行了一次sudo apt-get update,还是在报同样的错误,这种问题是和网络有关而不是和配置有关吗?
http://extras.ubuntu.com 的問題 也包含在
viewtopic.php?p=3148736#p3148736
3. 你的 domain name 都解析成 IPV6 但是 你的網路無法到達
裡面 一同處理

這個建議 也可以試試
viewtopic.php?p=3148737#p3148737
nangui.hu
帖子: 11
注册时间: 2015-11-17 10:41
系统: ubuntu14.04

Re: 执行apt-get update返回Failed to fetch ".../trusty/Release"

#20

帖子 nangui.hu » 2015-11-17 16:58

poloshiao 写了:
我照着上面的步骤做了,再执行了一次sudo apt-get update,还是在报同样的错误,这种问题是和网络有关而不是和配置有关吗?
<!-- m --><a class="postlink" href="http://extras.ubuntu.com">http://extras.ubuntu.com</a><!-- m --> 的問題 也包含在
<!-- l --><a class="postlink-local" href="viewtopic.php?p=3148736#p3148736">viewt ... 3148736</a><!-- l -->
3. 你的 domain name 都解析成 IPV6 但是 你的網路無法到達
裡面 一同處理
soloman@ubuntu:~$ sudo ping -c 3 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=2.39 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.182 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.156 ms

--- 127.0.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 0.156/0.911/2.396/1.050 ms
soloman@ubuntu:~$ sudo ping6 -c 3 ::1
PING ::1(::1) 56 data bytes
64 bytes from ::1: icmp_seq=1 ttl=64 time=2.81 ms
64 bytes from ::1: icmp_seq=2 ttl=64 time=0.200 ms
64 bytes from ::1: icmp_seq=3 ttl=64 time=0.093 ms

--- ::1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.093/1.037/2.819/1.260 ms
soloman@ubuntu:~$ sudo ping -c 3 forum.ubuntu.org.cn
PING forum.ubuntu.org.cn (192.157.242.155) 56(84) bytes of data.
64 bytes from 192.157.242.155: icmp_seq=1 ttl=128 time=215 ms
64 bytes from 192.157.242.155: icmp_seq=2 ttl=128 time=220 ms
64 bytes from 192.157.242.155: icmp_seq=3 ttl=128 time=223 ms

--- forum.ubuntu.org.cn ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 3285ms
rtt min/avg/max/mdev = 215.805/220.165/223.763/3.293 ms
soloman@ubuntu:~$ sudo ping -c 3 forum.ubuntu.org.cn
PING forum.ubuntu.org.cn (192.157.242.155) 56(84) bytes of data.
64 bytes from 192.157.242.155: icmp_seq=1 ttl=128 time=223 ms
64 bytes from 192.157.242.155: icmp_seq=2 ttl=128 time=210 ms
64 bytes from 192.157.242.155: icmp_seq=3 ttl=128 time=219 ms

--- forum.ubuntu.org.cn ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 210.098/217.416/223.021/5.426 ms
以上是我执行的结果
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 执行apt-get update返回Failed to fetch ".../trusty/Release"

#21

帖子 poloshiao » 2015-11-17 17:06

sudo ping -c 3 forum.ubuntu.org.cn
第四個 是
sudo ping6 -c 3 forum.ubuntu.org.cn
我剛剛發現漏掉 6 已更正了
nangui.hu
帖子: 11
注册时间: 2015-11-17 10:41
系统: ubuntu14.04

Re: 执行apt-get update返回Failed to fetch ".../trusty/Release"

#22

帖子 nangui.hu » 2015-11-17 17:20

poloshiao 写了:
sudo ping -c 3 forum.ubuntu.org.cn
第四個 是
sudo ping6 -c 3 forum.ubuntu.org.cn
我剛剛發現漏掉 6 已更正了
soloman@ubuntu:~$ sudo ping6 -c 3 forum.ubuntu.org.cn
connect: Network is unreachable

这是执行后的结果
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 执行apt-get update返回Failed to fetch ".../trusty/Release"

#23

帖子 vickycq » 2015-11-17 17:30

sudo ping6 -c 3 forum.ubuntu.org.cn
connect: Network is unreachable
这是执行后的结果
ipv6 不通?...
17楼的方案是否有效?
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
nangui.hu
帖子: 11
注册时间: 2015-11-17 10:41
系统: ubuntu14.04

Re: 执行apt-get update返回Failed to fetch ".../trusty/Release"

#24

帖子 nangui.hu » 2015-11-17 17:37

vickycq 写了:
connect: Network is unreachable
这是执行后的结果
17楼的方案是否有效?
按照17楼的第一行代码执行后一直停留在
100% [Waiting for headers]
不知有没有完成?
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 执行apt-get update返回Failed to fetch ".../trusty/Release"

#25

帖子 vickycq » 2015-11-17 17:40

按照17楼的第一行代码执行后一直停留在
100% [Waiting for headers]
不知有没有完成?
你人在北美?
根据自己所处位置,合理选择镜像源。
例如中国大陆可选择 http://mirrors.ustc.edu.cn/

PS. ubuntu 没有 httpredir 就是麻烦...
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
nangui.hu
帖子: 11
注册时间: 2015-11-17 10:41
系统: ubuntu14.04

Re: 执行apt-get update返回Failed to fetch ".../trusty/Release"

#26

帖子 nangui.hu » 2015-11-17 17:44

vickycq 写了:
按照17楼的第一行代码执行后一直停留在
100% [Waiting for headers]
不知有没有完成?
你人在北美?
根据自己所处位置,合理选择镜像源。
例如中国大陆可选择 <!-- m --><a class="postlink" href="http://mirrors.ustc.edu.cn/">http://mir ... edu.cn/</a><!-- m -->

PS. ubuntu 没有 httpredir 就是麻烦...
完成了,多谢了 :Hehe :Haha :Haha :Haha
Fetched 4,667 kB in 6min 46s (11.5 kB/s)
Reading package lists... Done
没在北美,公司是外企,可能用的网络是国外的吧
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 执行apt-get update返回Failed to fetch ".../trusty/Release"

#27

帖子 vickycq » 2015-11-17 17:56

Fetched 4,667 kB in 6min 46s (11.5 kB/s)
:Hehe
太慢了,换个源试试吧
http://extras.ubuntu.com 等多余的全部删掉

代码: 全选

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
上次由 vickycq 在 2015-11-17 18:07,总共编辑 3 次。
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
nangui.hu
帖子: 11
注册时间: 2015-11-17 10:41
系统: ubuntu14.04

Re: 执行apt-get update返回Failed to fetch ".../trusty/Release"

#28

帖子 nangui.hu » 2015-11-17 17:58

好,我摸索摸索,谢了
回复