驗證 openSUSE Tumbleweed 映像下載時出現問題

驗證 openSUSE Tumbleweed 映像下載時出現問題

當我嘗試使用sha256sum驗證剛下載的 openSUSE Tumbleweed 映像時,出現錯誤:

sha256sum: openSUSE-Tumbleweed-DVD-x86_64-Snapshot20170521-Media.iso: No such file or directory
openSUSE-Tumbleweed-DVD-x86_64-Snapshot20170521-Media.iso: FAILED open or read
sha256sum: WARNING: 14 lines are improperly formatted
sha256sum: WARNING: 1 listed file could not be read

我已驗證映像和校驗和位於同一目錄中,我已驗證它們具有相同的名稱(校驗和文件末尾的“.sha256”除外),並且我已驗證我下載了正確的文件我的圖像的校驗和。

答案1

問題出在校驗和文件本身。如果您在 vi 中開啟該文件,您會看到問題:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

c8206b18c4ee07b09807a60b653b7e3956d86002b7609f20ab63c9549049796b  openSUSE-Tumbleweed-DVD-x86_64-Snapshot20170521-Media.iso
-----BEGIN PGP SIGNATURE-----
...

問題在於校驗和期望找到的文件的名稱。更改第 4 行的檔案名稱以符合您下載的映像的名稱:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

c8206b18c4ee07b09807a60b653b7e3956d86002b7609f20ab63c9549049796b  openSUSE-Tumbleweed-DVD-x86_64-Current.iso
-----BEGIN PGP SIGNATURE-----
...

然後再次運行該sha256sum命令就可以了。此命令的預期輸出sha256sum類似於:

$ sha256sum -c openSUSE-Tumbleweed-DVD-x86_64-Current.iso.sha256
openSUSE-Tumbleweed-DVD-x86_64-Current.iso: OK
sha256sum: WARNING: 14 lines are improperly formatted

上傳新簽名的人忘記將預期的檔案名稱更改為當前的圖像名稱。如果您從瀏覽器下載校驗和文件,則更容易發現該問題。如果您從瀏覽器下載,該檔案將被命名為openSUSE-Tumbleweed-DVD-x86_64-Snapshot20170521-Media.iso.但是,如果您使用wget或類似的東西下載它,檔案名稱將openSUSE-Tumbleweed-DVD-x86_64-Current.iso按照您的預期命名,從而使問題變得模糊。

相關內容