MD5SUM

This article will explain how to generate a MD5 Checksum on a file or list of filesa and also how to validate a file against a known MD5 Checksum. For those of you that are not familiar with MD5 Checksums, the purpose is to validate the integrity of a file that may have been corrupted or tampered with. For example, it is possible for file to be corrupted in the process of downloading it from a website or FTP server. In order to verify if it has been corrupted or not, the publisher of the file you downloaded can include a MD5 Checksum (a string of numbers of letters) which is compared to the file you just downloaded. If the two checksums match, that means the files are identical – no corruption has occurred.  Now lets take a look at some examples.

Generate MD5 Checksum on a single file

md5sum filename

Generate MD5 Checksum on multiple files

md5sum filename1 filename2 filename3

Generate MD5 Checksum and ouptut to file

md5sum filename > md5.txt

Compare MD5 Checkum output file to current file in directory

md5sum -c md5.txt

Example of what a MD5 Checksum looks like

d4fdb933151cad1eb58e798d2874f8f6 send_file-1.0.0.7-0.i386.rpm

apt-get

What is apt-get?

The apt-get utility is a powerful and free package management command line program, that is used to work withUbuntu’s APT (Advanced Packaging Tool) library to perform installation of new software packages, removing existing software packages, upgrading of existing software packages and even used to upgrading the entire operating system.

What is apt-cache?

The apt-cache command line tool is used for searching apt software package cache. In simple words, this tool is used to search software packages, collects information of packages and also used to search for what available packages are ready for installation on Debian or Ubuntu based systems.

apt-get update updates the list of available packages and their versions, but it does not install or upgrade any packages.

apt-get upgrade actually installs newer versions of the packages you have. After updating the lists, the package manager knows about available updates for the software you have installed. This is why you first want to update.

apt-get dist-upgrade, in addition to performing the function of apt-get upgrade, also intelligently handles changing dependencies with new versions of packages and will attempt to upgrade the most important packages at the expense of less important ones if necessary. Thus, the apt-get dist-upgrade command may actually remove some packages in rare but necessary instances.

If you are for some reason want apt-get to just download the packages and dependencies without installing it, simply add -d switch to the command as the following.

sudo apt-get install -d package-name

The downloaded packages are located in the apt package cache at

/var/cache/apt/archives

Instead of using dpkg, which is a low level package manager, you’d be better off using apt. To install the .deb files using apt, copy them to the apt cache

sudo cp *.deb /var/cache/apt/archives/

and then just do the regular upgrade:

apt-get upgrade

The apt command will use the files in its cache rather than downloading it off the net, so that pretty much serves your purpose.