编辑:这可能是一个电缆调制解调器的问题:据https://test-ipv6.com/说,ipv6既不能在Ubuntu中工作,也不能在windows中工作(双重引导,同一个工作站),在我的智能手机上也不能工作,比如在wifi上(即相同的电缆调制解调器),而在禁用wifi的智能手机上工作(即移动数据)。所以我会联系我的ISP。
我有一个新的Ubuntu22.04安装在一个台式机与有线互联网连接。它具有默认的网络配置设置(来自电缆调制解调器的DHCP;IP地址)。
Internet访问在浏览器中运行良好。
然而,从命令行来看,一些程序(例如apt update或apt upgrade)似乎运行良好,虽然可能有些慢(?),而其他程序则失败,例如wget:
~$ wget https://raw.githubusercontent.com/ros2/ros2/rolling/ros2.repos
--2023-05-17 13:56:57-- https://raw.githubusercontent.com/ros2/ros2/rolling/ros2.repos
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 2606:50c0:8002::154, 2606:50c0:8001::154, 2606:50c0:8000::154, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8002::154|:443... failed: Connection timed out.
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8001::154|:443... ^C从the浏览器访问相同的链接会立即加载ros2.repos文件。
在raw.githubusercontent.com中添加一个条目"185.199.108.133“也解决了这个问题:
$ wget https://raw.githubusercontent.com/ros2/ros2/rolling/ros2.repos
--2023-05-17 14:52:18-- https://raw.githubusercontent.com/ros2/ros2/rolling/ros2.repos
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12144 (12K) [text/plain]
Saving to: ‘ros2.repos.1’
ros2.repos.1 100%[=======================================================================================================>] 11,86K --.-KB/s in 0s
2023-05-17 14:52:18 (124 MB/s) - ‘ros2.repos.1’ saved [12144/12144]所以我认为这是一个ipv4和ipv6的问题。虽然我不知道为什么它工作从浏览器,而不是从终端。
关于如何调试这一点,有什么建议吗?
发布于 2023-05-17 13:54:34
显然,wget可能偶尔会对IPv6地址产生问题。可以设置一个选项,使其始终只使用IPv4地址:
将inet4_only = on添加到/etc/wgetrc应该可以解决这个问题。
给和ipv6 6问题?的学分
https://askubuntu.com/questions/1468282
复制相似问题