我刚刚注意到 repo http://dl.google.com/linux/chrome/deb/

我刚刚注意到 repo http://dl.google.com/linux/chrome/deb/

多年来,Google Chrome 在 Ubuntu 上的更新方式是通过存储库http://dl.google.com/linux/chrome/deb/到目前为止,当我访问此 URL 时,我得到了 404。但不知何故,Chrome 似乎是最新版本。Chrome 是否正在以某种新的方式更新,也许是通过自我更新?还是它阻止通过浏览器和 wget 进行访问?

答案1

总结
这是为保护 APT 存储库免受机器人攻击而采取的有意措施。Google 没有关于http://dl.google.com/linux/chrome/deb/http://dl.google.comURL 的索引文档。
存储库本身运行正常。请参阅下面的分析。

细节
在我的 Ubuntu MATE 18.04.3 LTS 盒子上的 Wireshark 会话中,我看到使用用户代理sudo apt-get update下载URL。http://dl.google.com/linux/chrome/deb/dists/stable/InReleaseDebian APT-HTTP/1.3 (1.6.14)

因此,您可以通过使用“wget”访问上述 URL 来解决此问题,如下所示:

$ wget --spider --user-agent="Debian APT-HTTP/1.3 (1.6.14)" http://dl.google.com/linux/chrome/deb/
Spider mode enabled. Check if remote file exists.
--2022-02-13 10:07:18--  http://dl.google.com/linux/chrome/deb/
Resolving dl.google.com (dl.google.com)... 108.177.14.91, 108.177.14.136, 108.177.14.190, ...
Connecting to dl.google.com (dl.google.com)|108.177.14.91|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
Remote file does not exist -- broken link!!!

此处404已确认。

但访问上级http://dl.google.comURL 会出现重定向:

$ wget --spider --user-agent="Debian APT-HTTP/1.3 (1.6.14)" http://dl.google.com
Spider mode enabled. Check if remote file exists.
--2022-02-13 10:09:34--  http://dl.google.com/
Resolving dl.google.com (dl.google.com)... 64.233.161.190, 64.233.161.93, 64.233.161.136, ...
Connecting to dl.google.com (dl.google.com)|64.233.161.190|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://www.google.com/chrome [following]
Spider mode enabled. Check if remote file exists.
--2022-02-13 10:09:34--  http://www.google.com/chrome
Resolving www.google.com (www.google.com)... 64.233.163.105, 64.233.163.106, 64.233.163.99, ...
Connecting to www.google.com (www.google.com)|64.233.163.105|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://www.google.com/chrome/ [following]
Spider mode enabled. Check if remote file exists.
--2022-02-13 10:09:34--  http://www.google.com/chrome/
Connecting to www.google.com (www.google.com)|64.233.163.105|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://www.google.com/chrome/ [following]
Spider mode enabled. Check if remote file exists.
--2022-02-13 10:09:34--  https://www.google.com/chrome/
Connecting to www.google.com (www.google.com)|64.233.163.105|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 301722 (295K) [text/html]
Remote file exists and could contain further links,
but recursion is disabled -- not retrieving.

从上面的 HTTP 对话中你可以看到 302 重定向到https://www.google.com/chrome/这使得人们可以从官方网页下载 Google Chrome。

您也可以尝试InRelease直接使用相同的用户代理访问文件,如下所示:

$ wget --spider --user-agent="Debian APT-HTTP/1.3 (1.6.14)" http://dl.google.com/linux/chrome/deb/dists/stable/InRelease
Spider mode enabled. Check if remote file exists.
--2022-02-13 10:12:10--  >http://dl.google.com/linux/chrome/deb/dists/stable/InRelease
Resolving dl.google.com (dl.google.com)... 64.233.161.190, 64.233.161.93, 64.233.161.136, ...
Connecting to dl.google.com (dl.google.com)|64.233.161.190|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1811 (1,8K) [application/octet-stream]
Remote file exists.

甚至使用默认用户代理访问同一个文件:

$ wget --spider http://dl.google.com/linux/chrome/deb/dists/stable/InRelease
Spider mode enabled. Check if remote file exists.
--2022-02-13 10:15:18--  >http://dl.google.com/linux/chrome/deb/dists/stable/InRelease
Resolving dl.google.com (dl.google.com)... 64.233.161.190, 64.233.161.93, 64.233.161.91, ...
Connecting to dl.google.com (dl.google.com)|64.233.161.190|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1811 (1,8K) [application/octet-stream]
Remote file exists.

因此,您收到的 404 对于实际用例来说毫无意义。APT 需要其他通常可用的文件。

相关内容