[SOLVED] MD5Sum - How do I compute the MD5Sum of a downloaded iso?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
MD5Sum - How do I compute the MD5Sum of a downloaded iso?
Was running Windows 8.1 Pro till it got sick and died. I managed to install Ubuntu 14.04 on my sick computer over Windows wiping it out.
I first installed Linux Mint and downloaded Ubuntu. Somehow I was able to verify checksums or MD5Sums. I think my age is catching up with me and my mind doesn't work like it used to.
How do I find the MD5sum of a downloaded iso file. I've downloaded debian-7.8.0-amd64-DVD-1-3.iso's and both update DVD's as well. I've located the MD5Sum files on the Mirror. Now, how do I compare those numbers/letters with the iso's I've downloaded.
I know I need to run a program to compute the MD5 but can't find it in the menu. I see I need to read man pages and info pages, but can't find them either.
A brain is a terrible thing to waste, but mine needs help.
The program is called md5sum. Open a terminal and run:
Code:
md5sum file.iso
If you have an md5 file, you can check it with the -c flag
Code:
md5sum -c file.iso.md5
It will read the md5 file, get the name of the file to check out of it, calculate the md5, compare it to what's in the file, and tell you if there are any differences.
Last edited by suicidaleggroll; 01-28-2015 at 01:41 PM.
Also, if I run MD5Sum in a Terminal Window, do I need to be in the same directory where the files are located?
How do I compare the new created MD5Sum with the one posted on the Mirror? Do I just have to read it letter by letter, or is that an input for the MD5Sum program?
I know enough about Linux to be dangereous. I appreciate any guidance you may provide.
Here is the command I entered at the terminal and the result.
stephen@stephen:~/Downloads$ md5sum debian-update-7.8.0-amd64-DVD-1.iso.MD5SUMS
md5sum: debian-update-7.8.0-amd64-DVD-1.iso.MD5SUMS: No such file or directory
stephen@stephen:~/Downloads$ md5sum -c debian-update-7.8.0-amd64-DVD-1.iso.MD5SUMS
md5sum: debian-update-7.8.0-amd64-DVD-1.iso.MD5SUMS: No such file or directory
stephen@stephen:~/Downloads$
stephen@stephen:~/Downloads$ md5sum -c file.iso.MD5SUMS
md5sum: file.iso.MD5SUMS: No such file or directory
stephen@stephen:~/Downloads$
I'm not trying to be difficult. I know Linux is short on explaining errors. I know the file I want checked is in this directory as is the mdd5sums file. I'm just having difficulty with it.
It's not short on explaining errors, it's telling you exactly what the error is. You keep typing in random names that don't exist. You might as well be running "md5sum -c thisisnotafile.andisgoingtofail".
Typing random non-existent file names into the terminal will accomplish nothing. As I said before, and as you can see from the output of the "ls" you ran earlier, the file is called "MD5SUMS".
Code:
md5sum -c MD5SUMS
With Linux, you can't just hammer on the keyboard and hope for the best, you need to think about what you're running and why. What do you hope to accomplish? How will the command know what it is you're trying to do? If you don't understand how to use a command, visit its man page with the "man" command. In this case:
Code:
$ man md5sum
MD5SUM(1) User Commands MD5SUM(1)
NAME
md5sum - compute and check MD5 message digest
SYNOPSIS
md5sum [OPTION]... [FILE]...
DESCRIPTION
Print or check MD5 (128-bit) checksums. With no FILE, or when FILE is
-, read standard input.
-c, --check
read MD5 sums from the FILEs and check them
If you want more information, at the bottom of the man page is the command for more info
Code:
info coreutils 'md5sum invocation'
Which has this tiddbit on the -c flag
Code:
'-c'
'--check'
Read file names and checksum information (not data) from each FILE
(or from stdin if no FILE was specified) and report whether the
checksums match the contents of the named files. The input to this
mode of 'md5sum' is usually the output of a prior,
checksum-generating run of 'md5sum'. Each valid line of input
consists of an MD5 checksum, a binary/text flag, and then a file
name. Binary mode is indicated with '*', text with ' ' (space).
For each such line, 'md5sum' reads the named file and computes its
MD5 checksum. Then, if the computed message digest does not match
the one on the line with the file name, the file is noted as having
failed the test. Otherwise, the file passes the test. By default,
for each valid line, one line is written to standard output
indicating whether the named file passed the test. After all
checks have been performed, if there were any failures, a warning
is issued to standard error. Use the '--status' option to inhibit
that output. If any listed file cannot be opened or read, if any
valid line has an MD5 checksum inconsistent with the associated
file, or if no valid line is found, 'md5sum' exits with nonzero
status. Otherwise, it exits successfully.
Last edited by suicidaleggroll; 01-28-2015 at 02:39 PM.
Here is the output of the last attempt. It looks like we are making headway. I use copy and paste as much as possible to eliminate typos.
stephen@stephen:~/Downloads$ md5sum -c MD5SUMS
debian-7.8.0-amd64-DVD-1.iso: OK
md5sum: debian-7.8.0-amd64-DVD-10.iso: No such file or directory
debian-7.8.0-amd64-DVD-10.iso: FAILED open or read
debian-7.8.0-amd64-DVD-2.iso: OK
debian-7.8.0-amd64-DVD-3.iso: OK
md5sum: debian-7.8.0-amd64-DVD-4.iso: No such file or directory
debian-7.8.0-amd64-DVD-4.iso: FAILED open or read
md5sum: debian-7.8.0-amd64-DVD-5.iso: No such file or directory
debian-7.8.0-amd64-DVD-5.iso: FAILED open or read
md5sum: debian-7.8.0-amd64-DVD-6.iso: No such file or directory
debian-7.8.0-amd64-DVD-6.iso: FAILED open or read
md5sum: debian-7.8.0-amd64-DVD-7.iso: No such file or directory
debian-7.8.0-amd64-DVD-7.iso: FAILED open or read
md5sum: debian-7.8.0-amd64-DVD-8.iso: No such file or directory
debian-7.8.0-amd64-DVD-8.iso: FAILED open or read
md5sum: debian-7.8.0-amd64-DVD-9.iso: No such file or directory
debian-7.8.0-amd64-DVD-9.iso: FAILED open or read
md5sum: WARNING: 7 listed files could not be read
stephen@stephen:~/Downloads$ ls
Audio Disc.toc debian-7.8.0-amd64-DVD-3.iso
Audio Disc.toc.bin debian-update-7.8.0-amd64-DVD-1.iso
debian-7.8.0-amd64-DVD-1.iso debian-update-7.8.0-amd64-DVD-2.iso
debian-7.8.0-amd64-DVD-2.iso MD5SUMS
stephen@stephen:~/Downloads$
So debian-7.8.0-amd64-DVD-1.iso, debian-7.8.0-amd64-DVD-2.iso, and debian-7.8.0-amd64-DVD-3.iso all checked out ok. You didn't download any of the others, so it just printed an error saying it couldn't find them. For some reason the update ISOs you downloaded weren't in the MD5SUMS file.
I used gedit to open the MD5SUMS file and learned that I only have iso's for 1,2 and 3. The md5's for the update iso's are not included. Looks like 1,2 and 3 are all OK.
Here is how to do it without the MD5SUMS file:
1) Copy the correct md5sum number from the website into a new text file in your text editor -
EXAMPLE: 0307ffcd5046c176599904193899426e
2) In your File Manager, right-click on the folder containing the .iso file you downloaded, then chose Open In Terminal
3) In the terminal, enter the command: md5sum debian-update-7.8.0-amd64-DVD-1.iso
4) After a few seconds, it will give you the number. Copy the number to your text file, placing it under the original number, so that you can compare them at a glance.
EXAMPLE:
0307ffcd5046c176599904193899426e
0307ffcd5046c176599904193899426e
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.