Using sha1sum to check the integrity of downloaded files

Large downloads, such as an ISO image, should have their integrity checked before use.

1. Download the desired file. For the purpose of illustration here we will assume foobar.iso.

2. Obtain the packager’s sha1sum for the desired file.

Often this will be in a separate file in the same directory with a name suggestive of its contents, such as foobar.iso.sha1. Download it to the same directory as the desired file.

Other times the packager will simply post the sha1sum in a README or other text file, or on a web page. In that case create a text file in the following format:

sha1sum (two spaces, then) name_of_desired_file

For example:

5abe4cf9056ab55105407674ec8cc244  foobar.iso

Save the file as foobar.iso.sha1 in the same directory as the desired file.

3. As user, sha1sum -c foobar.iso.md5. Notice that you specifiy the sha1sum file, not the file being checked. Calculation will take a moment. If the checksums match, the reply will be “foobar.iso: OK”. In this case you are done.

4. If the checksums do not match, attempt to repair the download. If you have access to a BitTorrent download for the files, try using that and pointing it at the existing files: it should check them, find out where they are corrupt, and correct the problems. If the damaged file is an ISO image, try correcting the download using Parchive2.

REFERENCES
How To do SHA-1 checksum
You will sometimes see a .asc file; this is the digital signature of the file
Although SHA-1 is more secure, md5sum is more common

Advertisements

About Warren Post

So far: Customer support guy, jungle guide, IT consultant, beach bum, entrepreneur, teacher, diplomat, over-enthusiastic cyclist. Tomorrow: who knows?
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

2 Responses to Using sha1sum to check the integrity of downloaded files

  1. Pingback: Using md5sum to check the integrity of downloaded files | Warren's tech notes

  2. Pingback: Upgrading to openSUSE 42.3 | A maze of twisty little passages

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s