MD5SUM on Linux
Most Linux distributions come with the md5sum utility so installation is usually unnecessary. We are going to use the Ubuntu 8.10 LiveCD for the following example:
Check the iso file
Manual method
First open a terminal and go to the correct directory to check a downloaded iso file:
Then run the following command from within the download directory.
Code:
md5sum ubuntu-8.10-desktop-i386.iso
md5sum should then print out a single line after calculating the hash:
Code:
24ea1163ea6c9f5dae77de8c49ee7c03 ubuntu-8.10-desktop-i386.iso
Compare the hash (the alphanumeric string on left) that your machine calculated with the corresponding hash on the UbuntuHashes page.
An easy way to do this is to open the UbuntuHashes page in your browser, then copy the hash your machine calculated from the terminal into the "Find" box in your browser (in Firefox you can open the "Find" box by pressing <Ctrl> <F>).
When both hashes match exactly then the downloaded file is almost certainly intact. If the hashes do not match, then there was a problem with either the download or a problem with the server. You should download the file again from either the same mirror, or from a different mirror if you suspect a server error. If you continuously receive an erroneous file from a server, please be kind and notify the webmaster of that mirror so they can investigate the issue.
Semi-automatic method
Ubuntu distributes the MD5 hashes in a file called MD5SUMS near the bottom of the download page for your release
http://releases.ubuntu.com.
First download the MD5SUMS file to the same directory as the iso. Then run the following in a terminal.
Code:
cd download_directory
md5sum -c MD5SUMS
md5sum will generate a bunch of warnings. Don't worry: the OK message will be buried somewhere within it!
Code:
md5sum: ubuntu-8.10-alternate-amd64.iso: No such file or directory
ubuntu-8.10-alternate-amd64.iso: FAILED open or read
md5sum: ubuntu-8.10-alternate-i386.iso: No such file or directory
ubuntu-8.10-alternate-i386.iso: FAILED open or read
md5sum: ubuntu-8.10-desktop-amd64.iso: No such file or directory
ubuntu-8.10-desktop-amd64.iso: FAILED open or read
ubuntu-8.10-desktop-i386.iso: OK
md5sum: ubuntu-8.10-netbook-remix-i386.img: No such file or directory
ubuntu-8.10-netbook-remix-i386.img: FAILED open or read
md5sum: ubuntu-8.10-server-amd64.iso: No such file or directory
ubuntu-8.10-server-amd64.iso: FAILED open or read
md5sum: ubuntu-9.04-server-i386.iso: No such file or directory
ubuntu-8.10-server-i386.iso: FAILED open or read
md5sum: wubi.exe: No such file or directory
wubi.exe: FAILED open or read
md5sum: WARNING: 7 of 8 listed files could not be read
In this case the message we want is on the seventh line.
Code:
ubuntu-8.10-desktop-i386.iso: OK
Check the CD
So far so good, you have downloaded an iso and verified its integrity. When you boot from the CD you will be given the option to test its integrity. Great, but if the CD is corrupt then you have already wasted time rebooting. You can check the integrity of the CD without rebooting as follows.
Manual method
Check the calculated hash against UbuntuHashes as shown for the iso file above. Depending on your system, you may need to change cdrom to cdrom0 (or even cdrom1 if you have two CD drives).
Semi-automatic method
The MD5 hashes for every file on the CD are listed in a file called md5sum.txt. You can use this file to check the integrity of all the files on the CD.
Code:
cd /media/cdrom
md5sum -c md5sum.txt | grep -v "OK$"
This will automatically check every file against the MD5 hashes stored in the file. (Again, you may need to change cdrom, depending on your system). Beware, it can take a long time so don't worry if your terminal seems to have hung; provided the CD drive is still accessing, it is probably still working. It should not output anything if it there were no errors, and an error message if a file failed the check. The grep command filters out all of the files that pass the check, because there are usually a lot of them.
From:
https://help.ubuntu.com/community/HowToMD5SUM
Ubuntu Hashes:
md5 Hash
Version
a54366aa72d6b576ee8fc0215f8a13b9
ubuntu-10.04-alternate-amd64.iso
5b2dadacfd692b4f2d5c7cf034539262
ubuntu-10.04-alternate-i386.iso
3e0f72becd63cad79bf784ac2b34b448
ubuntu-10.04-desktop-amd64.iso
d044a2a0c8103fc3e5b7e18b0f7de1c8
ubuntu-10.04-desktop-i386.iso
0b0e0d36050d9980ec995262eb9f2e6b
ubuntu-10.04-netbook-armel+dove.img
9e0d6ac7b69bb7912d49369a6807e39d
ubuntu-10.04-netbook-armel+imx51.img
712277c7868ab374c4d3c73cff1d95cb
ubuntu-10.04-netbook-i386.iso
8ee25c78f4c66610b6872a05ee9ad81b
ubuntu-10.04-server-amd64.iso
15342636441181f7a19c65984b44e24c
ubuntu-10.04-server-i386.iso
e81f931b1de017520f6d4aa4f78c5c8b
wubi.exe
f79cede2a3cb74c6d9e028a2bcfc2e28
kubuntu-10.04-alternate-amd64.iso
8def8b39aceae8e27fdcf2af107991cb
kubuntu-10.04-alternate-i386.iso
5b256bf515ae49749ac03a1af9d407c0
kubuntu-10.04-desktop-amd64.iso
0ef722fd6b348e9dcf03812d071d68ba
kubuntu-10.04-desktop-i386.iso
40972633cea6c8d38ff26dade3eec51e
kubuntu-10.04-netbook-i386.iso
d1d2cedc4fdddc9529c8216ecb29e26f
edubuntu-10.04-dvd-amd64.iso
5eccab9d5956956c3dc28d5a6c4a2e69
edubuntu-10.04-dvd-i386.iso
a60a2c8e3cf4cb20ba9ca4339bea92cb
xubuntu-10.04-alternate-amd64.iso
62b06b14573c2fc5b2bf5a526da15e65
xubuntu-10.04-alternate-i386.iso
49d29d11c3eb51f862641a934c86dd79
xubuntu-10.04-desktop-amd64.iso
7f064bc012025a5307ef6d81b0bc4c87
xubuntu-10.04-desktop-i386.iso
From:
https://help.ubuntu.com/community/UbuntuHashes
Hope this helps
