Get yourself acquainted with mock to build rpm

Package management is one the key areas in the world of GNU/Linux system administration. Not only for system administrators but also for normal linux users it is an inevitable part that they need to be aware of in their day to day job. Even though hundreds of linux distros exist around us, number package management systems are very limited (in numbers). dpkg used by Debian with .deb format, RPM created by Red Hat with .rpm format, pacman used in Arch linux, portage by Gentoo etc are some of the popular ones among them. Considering the most used RPM and DEB packages, they both have proven to work flawless. It’s just a matter of personal taste to select one from the other. Here we discuss on how to build RPM based packages for different distros which makes you of .rpm to install softwares. Here is how a rpm package would like:

<name>-<version>-<release>.<architecture>.rpm
such as:

samba-4.2.3-1.fc23.x86_64.rpm

where <name> is samba, <version> is 4.2.3, <release> is 1.fc23 and <architecture> is x86_64. <release> part is often a combination of a positive integer with a distribution tag appended at its end. See here for more details.

Read More »

Using Md5sum to ensure the protection of software packages

Image

It sounds weird but actually simplest of all other things. sha1, md5sum etc are well known for generating hash values(one-way encryption) to software packages or even individual files. Sometimes, a developer will use the md5sum command to generate a hash of the file. You can use this hash and the md5sum command to ensure that the file has not been altered. Easiest way to do this is to read the hash from the original developer and run md5sum against the package you downloaded. I will explain the method with a simple example.

Suppose I have with me a copy of package named foo.deb and I know the corresponding hash value from the developer itself. Somehow I learnt that foo.deb has a security problem. I wish to install the latest secure version. After downloading it, I will run md5sum against the file

user@GNULinux:~$ md5sum foo.deb
    d41d8cd98f00b204e9800998ecf8427e  foo.deb

However, I notice that the developer’s md5sum value for the same program reads as follows
Read More »