我带你去旅行。
我正在尝试通过MD5重新下载并验证Apache Spark(http://www.apache.org/dist/spark/spark-1.6.0/spark-1.6.0-bin-hadoop2.6.tgz) Debian(Jessie)机器。
该md5sum
脚本已存在于该计算机上,而我无需执行任何操作。
因此,我将MD5校验和(http://www.apache.org/dist/spark/spark-1.6.0/spark-1.6.0-bin-hadoop2.6.tgz.md5)下载到同一目录作为下载的Spark,然后执行:
md5sum -c spark-1.6.0-bin-hadoop2.6.tgz.md5
失败的原因是:
md5sum: spark-1.6.0-bin-hadoop2.6.tgz.md5: no properly formatted MD5 checksum lines found
所以我通过检查内容cat spark-1.6.0-bin-hadoop2.6.tgz.md5
:
spark-1.6.0-bin-hadoop2.6.tgz: 62 4B 16 1F 67 70 A6 E0 E0 0E 57 16 AF D0 EA 0B
这就是整个文件。在我看来不错-也许Spark下载实际上很糟糕?在做这个假设之前,我首先要通过md5sum spark-1.6.0-bin-hadoop2.6.tgz
以下命令了解MD5的含义:
624b161f6770a6e0e00e5716afd0ea0b spark-1.6.0-bin-hadoop2.6.tgz
嗯,这是一种完全不同的格式-但是,如果您足够努力地看,您会发现数字和字母实际上是相同的(小写字母和空格除外)。看起来md5sum
Debian随附的遵循不同的标准。
也许还有另一种方式可以运行此命令?让我们尝试md5sum --help
:
Usage: md5sum [OPTION]... [FILE]...
Print or check MD5 (128-bit) checksums.
With no FILE, or when FILE is -, read standard input.
-b, --binary read in binary mode
-c, --check read MD5 sums from the FILEs and check them
--tag create a BSD-style checksum
-t, --text read in text mode (default)
The following four options are useful only when verifying checksums:
--quiet don't print OK for each successfully verified file
--status don't output anything, status code shows success
--strict exit non-zero for improperly formatted checksum lines
-w, --warn warn about improperly formatted checksum lines
--help display this help and exit
--version output version information and exit
The sums are computed as described in RFC 1321. When checking, the input
should be a former output of this program. The default mode is to print
a line with checksum, a character indicating input mode ('*' for binary,
space for text), and name for each FILE.
GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Report md5sum translation bugs to <http://translationproject.org/team/>
Full documentation at: <http://www.gnu.org/software/coreutils/md5sum>
or available locally via: info '(coreutils) md5sum invocation'
好的,--tag
似乎更改了格式。让我们尝试md5sum --tag spark-1.6.0-bin-hadoop2.6.tgz
:
MD5 (spark-1.6.0-bin-hadoop2.6.tgz) = 624b161f6770a6e0e00e5716afd0ea0b
确实,这是一种不同的格式,但仍然不是正确的格式。.因此,我查看“ Apache下载镜像”页面上的说明,并找到以下文本:
或者,您可以验证文件上的MD5哈希。许多unix发行版中都包含一个称为
md5
或的unix程序md5sum
。它也可以作为GNU Textutils的一部分使用。
因此,我点击了该链接,发现Textutils在2003年被合并到Coreutils中-因此我实际上想要md5sum
从Coreutils中获得。但是,您可以在md5sum --help
转储的底部看到它已经来自Coreutils。
这可能意味着我的Coreutils已过时。所以我会apt-get update && apt-get upgrade coreutils
,但是后来我发现:
Calculating upgrade... coreutils is already the newest version.
那真是死路一条..但是等等,他们说“md5
或md5sum
”!让我们检查一下线索。
该md5
脚本尚不存在,所以我将尝试apt-get install md5
:
E: Unable to locate package md5
现在我迷路了,因此向Google寻求帮助,然后向StackOverflow寻求帮助。
那么,两种不同的MD5文件格式是什么?我该如何处理这个问题(并最终验证我的Apache Spark)?
我相信gpg --print-md md5 spark-1.6.0-bin-hadoop2.6.tgz
应该与.md5文件的内容匹配。
md5 / sha文件的格式存在问题,因为生成spark版本的脚本gpg --print-md md5
用于创建签名文件。参见:https : //issues.apache.org/jira/browse/SPARK-5308
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句