Create a Self-Extracting Installer in Linux

by | Nov 19, 2014 | Software Development, Solutions

Ultimately many would want to write complex RPMs to install software packages, however, those who are accountable for writing such packages may agree that this task may be cumbersome and impractical.

Where the RPM may accomplish the goal of wrapping an application in some sort of container for distribution, this goal is also possible by using a self-extracting archive or an installer which can launch an embedded script.

This is where a utility called makeself comes in. Makeself is described as “a small shell script that generates a self-extractable tar.gz archive from a directory. The resulting file appears as a shell script (many of those have a .run suffix) and can be launched as is.

Install makeself

cd /opt/app
chmod 755
cd makeself-2.1.5
cp *.sh /usr/bin

Suppose you want to package and distribute a version of libevent2 for several CentOS 6 servers. Here is one way.

mkdir rpmfile
cd rpmfile


echo '#!/bin/bash
yum install -y libevent2-2.0.21-1.1.x86_64.rpm libevent-devel-2.0.21-1.1.x86_64.rpm' >
chmod +x
cd ..

Command ./DIRECTORY ./ "SFX installer for COMMENT HERE" ./ ./rpmfile ./ "SFX installer for libevent-devel (2.0.21)" ./

Use the .run file




Need a bit more info on how Armedia can help you?

Feel free to schedule a 30-minute no-obligations meeting.