![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 | ||||||||
|
Ubuntu Guru
![]() |
md5sum and sha1sum are utilities to check the integrity of a file, usually a downloaded iso
In this example I will use "Ubuntu.iso" and a file "groups", but this works with any file. Note: This how is performed entirely in a terminal (CLI). No GUI. GUI Tool ~ Windows/Mac/Linux versions : md5 file check (Penguin byte) EDIT: The section on multiple files was added at the suggestion of 655 (Thanks 655). md5sum Create a *.md5 file: Code:
md5sum Ubuntu.iso > Ubuntu.iso.md5 This is an example of how to create a *.md5 on a file you trust. Give this to others to verify the integrity of a file or iso you authored. See "How to use md5sum and sha1sum files to verify integrity of downloaded iso images or files" section below. Verify md5sum of a file or iso: Code:
md5sum -c Ubuntu.iso.md5 Create a *.sha1 file: Code:
sha1sum Ubuntu.iso > Ubuntu.iso.sha1 This is an example of how to create a *.sha1 on a file you trust. Give this to others to verify the integrity of a file or iso you authored. See "How to use md5sum and sha1sum files to verify integrity of downloaded iso images or files" section below. Verify sha1sum of a file or iso: Code:
sha1sum -c Ubuntu.iso.sha1 Format of a *.md5 or *.sha1: Quote:
Sample *.md5 and *.sha1 file contents: groups.md5 (file = groups) Quote:
Quote:
Note:
Code:
cd ~/Desktop md5sum -c iso.md5 Create an *.iso.md5 or *.iso.sha1 file (to check integrity):
Examples (CLI) Examples using a file groups: Quote:
This will check any ubuntu*.iso in the current directory. You will get an error message if the file does not exist, the 2>/dev/null redirects the error message. Code:
md5sum -c MD5SUMS 2>/dev/null Quote:
K3b will show the md5sum of the iso and check (show) the md5sum of the burned CD/DVD automatically (which is part of the reason I would advise K3b over other options). From the CLI: Note: Some consider this method to be unreliable.
Example Note: On my box my CD is /dev/hda Quote:
Automation This involves some fancy CLI footwork: md5sum: Code:
md5sum /dev/hda > ./test && diff ./test /home/bodhi/MyDownloads/fluxbuntu.iso.md5 && rm -f ./test Quote:
Code:
sha1sum /dev/hda > ./test && diff ./test /home/bodhi/MyDownloads/fluxbuntu.iso.sha1 && rm -f ./test Quote:
Note: You must supply the proper path to the iso.md5 and iso.sha1. Windows users Windows md5sum checker (Free, opensource): winMd5Sum Windows sha1sum checker (Free, opensource): sha1sum Note: This is run from the windows command line, no gui. See link for instructions. Download with confidence bodhi.zazen
__________________
A person with ubuntu is open and available to others, affirming of others, does not feel threatened that others are able and good, for he or she has a proper self-assurance that comes from knowing that he or she belongs in a greater whole and is diminished when others are humiliated or diminished, when others are tortured or oppressed. ~ Archbishop Desmond Tutu, 1999 ![]() Last edited by bodhi.zazen; October 29th, 2008 at 03:08 PM.. |
||||||||
|
|
|
|
|
#2 |
|
Way Too Much Ubuntu
![]() Join Date: Jun 2006
Location: /Earth/Asia/Vietnam
Beans: 211
Ubuntu 8.04 Hardy Heron
|
Re: Verify downloaded iso integrity with md5sum or sha1sum
Great HOWTO, it's clear and easy-to-follow, many thanks
__________________
.:.:.[)[@[)|2.:.:. "Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side-effect." -- Linus Torvald. |
|
|
|
|
|
#3 |
|
Just Give Me the Beans!
![]() Join Date: Nov 2006
My beans are hidden!
Ubuntu 9.04 Jaunty Jackalope
|
Re: Verify downloaded iso integrity with md5sum or sha1sum
Reviving a somewhat old thread here, but...
It was very instructive and to-the-point, thank you. My one question is, is there a way to run this command on a batch of files at once, with separate .md5 files being generated for each file? Or to have it work recursively in several directories? Maybe I need a separate utility to do this ![]() |
|
|
|
|
|
#4 | ||
|
Ubuntu Guru
![]() |
Re: Verify downloaded iso integrity with md5sum or sha1sum
Quote:
Absolutely. The files must to be checked must all be in the same directory, and the *.md5 must also be in the same directory. Example: File name = MD5SUMS Quote:
Code:
md5sum -c MD5SUMS You will get an error message if the file does not exist.. So: Code:
md5sum -c MD5SUMS 2>/dev/null I will add this to the how-to... HTH
__________________
A person with ubuntu is open and available to others, affirming of others, does not feel threatened that others are able and good, for he or she has a proper self-assurance that comes from knowing that he or she belongs in a greater whole and is diminished when others are humiliated or diminished, when others are tortured or oppressed. ~ Archbishop Desmond Tutu, 1999 ![]() |
||
|
|
|
|
|
#5 |
|
Just Give Me the Beans!
![]() Join Date: Nov 2006
My beans are hidden!
Ubuntu 9.04 Jaunty Jackalope
|
Re: Verify downloaded iso integrity with md5sum or sha1sum
bodhi.zazen:
Thank you for more tips I had a more strange and complicated scenario in mind, but I will try the limits of this method for now. |
|
|
|
|
|
#6 |
|
Way Too Much Ubuntu
![]() Join Date: Nov 2006
Location: Rome, Italy
Beans: 262
Ubuntu 7.10 Gutsy Gibbon
|
Re: Verify downloaded iso integrity with md5sum or sha1sum
hi everyone, got a shell-newbie-question on
"How to use md5sum and sha1sum files to verify integrity of downloaded iso images or files" i downloaded the dapper-iso-file and now i'm stuck trying to check out the md5sum. i followed the instructions (by the way: thanks to all you patient cracks out there who help us little hatchlings) step 1. to 3. i managed to create the Ubuntu.iso.md5sum (how fascinating, a command line ) both the Ubuntu.iso.md5sum and the ubuntu-6.06.1-desktop-i386.iso are on the desktop but i get stuck at step 4. i'm not sure what to type! this is my cli: mat@mat-laptop:~/Desktop$ md5sum -c iso.md5 md5sum: iso.md5: No such file or directory so i gave it another try: mat@mat-laptop:~/Desktop$ md5sum -c ubuntu.6.06.1-desktop-i386.iso.md5sum md5sum: ubuntu.6.06.1-desktop-i386.iso.md5sum: No such file or directory and another one: mat@mat-laptop:~/Desktop$ md5sum -c ubuntu-6.06.1-desktop-i386.md5 md5sum: ubuntu-6.06.1-desktop-i386.md5: No such file or directory well, obviously i missed something... damn bill for making me so gui-dependent can anyone help? regards, buuntuu |
|
|
|
|
|
#7 |
|
Ubuntu Guru
![]() |
Re: Verify downloaded iso integrity with md5sum or sha1sum
Your active or "working directory" needs to be that in which the .iso and md5 are located.
In your case that is ~/Desktop (~ is short hand for /home/user_name). In the terminal: Code:
cd ~/Desktop md5sum -c Ubuntu.iso.md5sum I hope you got the Ubuntu.iso.md5sum from ubuntu. Ubuntu distributes the md5sums as a file "MD5SUMS" Here is the link: MD5SUMS Open and save the file to you desktop as MD5SUMS . Then : Code:
cd ~/Desktop md5sum -c MD5SUMS
__________________
A person with ubuntu is open and available to others, affirming of others, does not feel threatened that others are able and good, for he or she has a proper self-assurance that comes from knowing that he or she belongs in a greater whole and is diminished when others are humiliated or diminished, when others are tortured or oppressed. ~ Archbishop Desmond Tutu, 1999 ![]() Last edited by bodhi.zazen; December 8th, 2006 at 06:33 PM.. |
|
|
|
|
|
#8 |
|
Way Too Much Ubuntu
![]() Join Date: Nov 2006
Location: Rome, Italy
Beans: 262
Ubuntu 7.10 Gutsy Gibbon
|
Re: Verify downloaded iso integrity with md5sum or sha1sum
thanks for the fast reply
my md5sums were from where you indicated... however, the reply remains the same: md5sum: Ubuntu.iso.md5sum: No such file or directory well, you can't understand everything right away. in the end i did it the old-fashioned-way...good idea not deleting windows right away still do need my carrying wheels! |
|
|
|
|
|
#9 |
|
Ubuntu Guru
![]() |
Re: Verify downloaded iso integrity with md5sum or sha1sum
Can you post the output of:
Code:
ls ~/Desktop
__________________
A person with ubuntu is open and available to others, affirming of others, does not feel threatened that others are able and good, for he or she has a proper self-assurance that comes from knowing that he or she belongs in a greater whole and is diminished when others are humiliated or diminished, when others are tortured or oppressed. ~ Archbishop Desmond Tutu, 1999 ![]() |
|
|
|
|
|
#10 |
|
Just Give Me the Beans!
![]() |
Re: Verify downloaded iso integrity with md5sum or sha1sum
Thanks for the tutorial. Note though, that you mention the command to check sha1 sums as
Code:
sha1 -c <sha1sum-file> Code:
sha1sum -c <sha1sum-file> |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|