Master CentOS Software Installation: From Source Tarballs to RPM and Yum
This guide walks you through installing software on CentOS using three primary methods—source/tarball compilation, RPM packages, and Yum—demonstrating each approach with real‑world examples such as Redis, RabbitMQ, and Nginx, and covering essential concepts, commands, and configuration steps.
Preface
We target CentOS systems. CentOS software management includes three main methods: source/tarball, RPM, and Yum.
During the explanation of each installation method, we will install example software commonly used in development: source installation of Redis, RPM installation of RabbitMQ, and Yum installation of Nginx.
Key terms for source and tarball installation
Before installing, define a few terms that developers should already know.
Open source : source code written in a programming language, not directly executable by the system.
Compilation : translating source code into machine‑readable language.
gcc : the standard C compiler on Linux, maintained by the GNU project.
Executable file: the binary produced after compilation that the machine can run.
Function library: reusable code packaged as either a dynamic library (
.so) or a static library (
.a). Dynamic libraries are linked at runtime, while static libraries are merged into the executable at build time.
Diagram of the gcc compilation process.
Tarball: a compressed archive that usually contains the source code, a configure script, and documentation such as README or INSTALL files.
Tarball installation of Redis – practical steps
Basic steps:
Download the source tarball to
/usr/local/srcand extract it.
Read the
installand
READMEfiles for instructions.
Install any required dependencies.
Run
./configureto generate a Makefile.
Run
make clean(optional, removes previous build artifacts).
Run
maketo compile the source.
Run
make installto install the binaries to the target location.
Common commands explained:
./configure: creates a Makefile based on the current system environment.
make clean: removes old object files to ensure a fresh build.
make: compiles the source into object files and links them.
make install: copies the compiled binaries to their final locations.
Compilation flow diagram.
Redis installation screenshots (download, extract, compile, configure, start, verify).
RPM and SRPM basics
RPM (RedHat Package Manager) stores software in a package that records dependencies, version, and required configuration. Installing an RPM is fast but the target system must match the environment used to build the package.
Dependencies are similar to needing .NET for MSSQL or Erlang for RabbitMQ.
Difference between RPM and SRPM illustrated.
RPM package naming convention diagram.
Typical RPM install command:
<code># rpm -ivh package_name</code>Options:
-i– install.
-v– verbose output.
-h– show installation progress.
Installing RabbitMQ via RPM
RabbitMQ depends on Erlang, so we first install Erlang using a third‑party Yum repository.
<code># yum install epel-release</code> <code># yum install unixODBC unixODBC-devel wxBase wxGTK SDL wxGTK-gl</code>Install Erlang RPM (example shows a dependency error that is resolved by the previous step) and then install the RabbitMQ RPM.
<code># rpm -ivh esl-erlang_19.2~centos~7_amd64.rpm</code> <code># rpm -ivh rabbitmq-server-3.6.6-1.el7.noarch.rpm</code>Start and stop RabbitMQ:
./rabbitmq-server– start.
./rabbitmq-server -detached– run in background.
./rabbitmqctl stop– stop.
Open required firewall ports (15672, 25672, 5672, 4369, 5671) in
/etc/sysconfig/iptables:
<code># vim /etc/sysconfig/iptables
-A INPUT -p tcp -m state --state NEW -m tcp --dport 15672 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 25672 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 5672 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 4369 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 5671 -j ACCEPT</code>Enable the management plugin (run once):
<code># ./rabbitmq-plugins enable rabbitmq_management</code>Access the management UI at
http://<server_ip>:15672(default guest user may need to be changed).
Yum installation details
Yum simplifies dependency resolution. Example to install Nginx:
<code># yum install nginx</code>Yum repository configuration files are located in
/etc/yum.confand the directory
/etc/yum.repos.d/.
<code># ll /etc | grep yum
-rw-r--r--. 1 root root 970 11月 15 23:30 yum.conf
-rwxr-xr-x. 2 root root 4096 2月 7 20:10 yum.repos.d</code>Raymond Ops
Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.