26

How can I install MD5 in Ubuntu without using apt-get?

Olli
  • 7,739
Miki
  • 369

5 Answers5

33

Ubuntu has included md5sum in their distro for several years now (always?), no need to install.

https://help.ubuntu.com/community/HowToMD5SUM

ubiquibacon
  • 8,244
  • 3
  • 31
  • 37
9

coreutils should contain md5sum. If you don't have even that installed... you have bigger problems than not being able to md5sum. (like no ls, cat, mkdir...)

slhck
  • 235,242
Hello71
  • 8,673
  • 5
  • 42
  • 45
2

Install md5sum from this

sudo apt install -y ucommon-utils

Check that it has installed with this

md5sum --version

Sample 1 - Returns md5 hash of the file

md5sum /pathToFile/file

Sample 2 - Compares two md5 hashes against each other and does something

#!/bin/bash
file1="sudo md5sum /pathToFile/file.txt"
file2="sudo md5sum /pathToFile2/file2.txt"
if [ "$file1" = "$file2" ]
then
    echo "Files have the same content"
else
    echo "Files do NOT have the same content"
fi
Josh
  • 131
2

typoknig is correct in that Ubuntu comes with md5sum. It is part of the GNU coreutils package, which is included in almost every desktop Linux distro by default.

However, if for some unlikely reason coreutils is not installed, you can go to http://packages.ubuntu.com/coreutils and download the package file (as well as any necessary dependencies, if you don't have those already), then install it with sudo dpkg -i <filename>, where <filename> is the name of the package file.

(This works for any other package as well - they are all available from http://packages.ubuntu.com, so if you need to install an application on some PC without an internet connection you can install packages manually if necessary. Just make sure to install the required dependencies first.)

EDIT: However, based on your earlier question, this is not actually your problem. You need to install the libssl-dev package.

slhck
  • 235,242
user55325
  • 5,113
2

Checksums calculator is a GUI tool to calculate MD5 checksums which can run under Linux, Windows and Mac OS X.

Ubuntu version

Gareth
  • 19,080
saverio
  • 21