Ask Your Question
1

Checksum Fail - Fedora 29 or spin KDE Plasma

asked 2019-03-31 13:37:59 -0600

spCl gravatar image

Hi!

I tried checksum Fedora Workstation 29 and Fedora KDE Plasma but it's always fail. Am I doing something wrong, is the tutorial incomplete or the file in the server is corrupted?

Details :

I use Windows -> commands in Powershell:

FOR KDE :

$image = "Fedora-KDE-Live-x86_64-29-1.2.iso"
$checksum_file = ""Fedora-Spins-29-1.2-x86_64-CHECKSUM"
$sha256 = New-Object -TypeName System.Security.Cryptography.sha256CryptoServiceProvider $expected_checksum = ((Get-Content $checksum_file | Select-String -Pattern $image) -split " ")[0].ToLower()

$download_checksum = [System.BitConverter]::ToString($sha256.ComputeHash([System.IO.File]::ReadAllBytes("$PWD\$image"))).ToLower() -replace '-', ''

echo "Download Checksum: $download_checksum"
Download Checksum: 5f7103a79e705bc1be95b7a2350b82cae857196542396cec0e3e7dfd7d16815a
echo "Expected Checksum: $expected_checksum"
Expected Checksum: #
if ( $download_checksum -eq "$expected_checksum" ) { echo "Checksum test passed!" } else { echo "Checksum test failed." }
Checksum test failed.


For workstation:

$image = "Fedora-Workstation-Live-x86_64-29-1.2.iso"
$checksum_file = "Fedora-Workstation-29-1.2-x86_64-CHECKSUM"
$sha256 = New-Object -TypeName System.Security.Cryptography.sha256CryptoServiceProvider
$expected_checksum = ((Get-Content $checksum_file | Select-String -Pattern $image) -split " ")[0].ToLower()

$download_checksum = [System.BitConverter]::ToString($sha256.ComputeHash([System.IO.File]::ReadAllBytes("$PWD\$image"))).ToLower() -replace '-', ''

echo "Download Checksum: $download_checksum"
Download Checksum: 653cc283749100e9b46625d23938ff890ae29482bef142f5a0f99c5a5ddc03e9
echo "Expected Checksum: $expected_checksum"
Expected Checksum: #
if ( $download_checksum -eq "$expected_checksum" ) {echo "Checksum test passed!"} else {echo "Checksum test failed."}
Checksum test failed.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-03-31 17:29:54 -0600

ozeszty gravatar image

updated 2019-03-31 17:43:47 -0600

Hi,

If you manually compare computed checksums with what's in checksum files, you'll see that they match. Checksum files are regular text files, so open them in notepad and search for what your command reported after "Download Checksum: ".

Your code expected different layout of checksums file, where checksum, separated by a space, is preceding the file name ($expected_checksum = ((Get-Content $checksum_file | Select-String -Pattern $image) -split " ")[0].ToLower()). In both checksum files, image file names were preceded by #, and this is what your script compared computed checksums with: "Expected Checksum: #".

I'll report that image verifying instructions for Windows users are outdated in Fedora Docs.

Have fun on Fedora!

P.S. The script will work if you update the fourth line to: $expected_checksum = ((Get-Content $checksum_file | Select-String -Pattern $image) -split "\) = ")[2].ToLower()

edit flag offensive delete link more

Comments

Oh, super, it works now! :) Thank you!

spCl gravatar imagespCl ( 2019-04-01 06:47:53 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-03-31 13:37:59 -0600

Seen: 88 times

Last updated: Mar 31 '19