Package & Software Management
Module 7 · System Configuration & Software

Package & Software Management

RPM/DNF and DPKG/APT across the two major distro families, archiving with tar, and building software from source.

Package Managers by Distro Family

A package manager installs, updates, inventories, and uninstalls packaged software, automatically resolving dependencies so you don’t have to track them by hand.

Distro familyLow-level toolHigh-level tool
RHEL, Rocky, AlmaLinux, Fedorarpmdnf (the modern replacement for yum, which still works as an alias on most systems)
Debian, Ubuntu, Linux Mint, Kalidpkgapt

The low-level tools (rpm, dpkg) operate on individual package files and know nothing about remote repositories or dependency resolution. The high-level tools (dnf/yum, apt) manage repositories, resolve and pull in dependencies automatically, and are almost always what you actually want to run.


RPM-Based Systems: rpm and dnf

TaskCommand
Install a local .rpm filerpm -i package.rpm
Remove a packagerpm -e package
Upgrade a packagerpm -U package.rpm
Query whether a package is installedrpm -q package
List all installed packagesrpm -qa
Find which installed package owns a given filerpm -qf /path/to/file
Show detailed info about an installed packagerpm -qi package
Install from a configured repository, resolving dependenciesdnf install package
Remove a package (and unused dependencies)dnf remove package
Update all packagesdnf update
Search repositories by keyworddnf search keyword
List available or installed packagesdnf list installed
View transaction historydnf history

Debian-Based Systems: dpkg and apt

TaskCommand
Install a local .deb filedpkg -i package.deb
Remove a packagedpkg -r package
List installed packagesdpkg -l
Find which package owns a given filedpkg -S /path/to/file
Install from a configured repository, resolving dependenciesapt install package
Remove a packageapt remove package
Refresh the local package index from repositoriesapt update
Upgrade all installed packagesapt upgrade
Search available packages by keywordapt search keyword
⚠️ Common Pitfall: rpm/dpkg vs. dnf/apt: Know Which Layer You're On

rpm -i and dpkg -i will refuse to install a package if its dependencies aren’t already present on the system — they don’t reach out to a repository to fetch anything. If a scenario question describes a dependency failure during a manual .rpm/.deb install, the fix is either to install the missing dependencies first, or to use the high-level tool (dnf/apt) instead, which resolves and fetches them automatically.


Downloading, Archiving, and Compressing

TaskCommand
Download a file over HTTP/HTTPS/FTP from the command linewget URL or curl -O URL
Create a tar archivetar -cvf archive.tar directory/
Extract a tar archivetar -xvf archive.tar
Create a compressed tar archive (gzip)tar -czvf archive.tar.gz directory/
Create a compressed tar archive (bzip2, better ratio, slower)tar -cjvf archive.tar.bz2 directory/
Compress a file directly (without archiving multiple files)gzip file (also bzip2, xz — trading speed for compression ratio)

tar (tape archiver) bundles multiple files/directories into a single archive file; it doesn’t compress by default — the z (gzip) or j (bzip2) flags add compression on top of the archiving step.


Building Software From Source

Not everything ships as a pre-built package. Building from source generally follows this pattern:

StepPurpose
./configureChecks for required dependencies and generates a Makefile tailored to this system
makeCompiles the source — automatically looks for a file literally named Makefile in the current directory
make installCopies the compiled binaries and supporting files into their final system locations

A compiler (gcc/cc for C, g++ for C++) translates human-readable source code into machine-readable binaries. Libraries are chunks of pre-compiled code that multiple programs can share instead of each reimplementing the same functionality — check which shared libraries a compiled binary actually depends on with:

ldd /path/to/binary
⚠️ Common Pitfall: Verify Dependencies Are in the Repositories Before You Start

Before attempting any deployment or ./configure run, check that every required dependency is actually available — either already installed or present in a configured repository (dnf search/apt search). Discovering a missing dependency halfway through a make run wastes far more time than checking up front.


🧠 Knowledge Check

1. You run `rpm -i somepackage.rpm` and it fails, complaining about missing dependencies. Why doesn't it just fetch them?

2. What does the 'z' flag do in `tar -czvf archive.tar.gz directory/`?

3. When building software from source, what does the ./configure step actually do?


What’s Next

Module 8 covers the last major exam domain in this course: networking configuration, diagnostics, and securing the whole system end to end.