Package management is the core of Linux system administration. Whether you manage software on Red Hat-derived distributions (Fedora, RHEL, CentOS, Rocky Linux) or Debian-derived distributions (Ubuntu, Linux Mint, Debian, Pop!_OS), understanding how packages, repositories, cache cleaning, cross-format conversions, and graphical package managers work is an essential skill.
This comprehensive guide covers repository management, cache cleaning, viewing installed software, cross-format conversions (.deb to .rpm), full command-line references for both ecosystems, and native Graphical User Interface (GUI) package managers.
Part 1: The Linux Package Management Ecosystem
At a high level, Linux distributions fall into two primary package management families:
- The RPM Family (Fedora, RHEL, CentOS): Uses
.rpmpackages, managed by low-levelrpmand high-leveldnf(or legacyyum). - The DEB Family (Ubuntu, Linux Mint, Debian): Uses
.debpackages, managed by low-leveldpkgand high-levelapt.
Low-Level vs. High-Level Package Managers
- Low-Level Managers (
rpmanddpkg): These tools deal directly with individual package files (.rpmor.deb). They can install, remove, and query local files, but they do not automatically resolve or download dependencies. - High-Level Managers (
dnf/yumandapt): Intelligent wrapper tools connected to online software repositories that automatically handle dependency trees, updates, and repository metadata.
Part 2: Repository and Cache Administration
Package managers rely on online metadata repositories and local caching directories to function efficiently. Managing these caches and repositories prevents disk bloat and allows access to third-party software.
Managing Package Caches (Cleaning Up Disk Space)
Over time, high-level package managers store downloaded package archives in local caches. Clearing these caches recovers significant disk space.
- DNF (Fedora / RHEL / CentOS): To remove all cached package headers and downloaded
.rpmfiles:Bashsudo dnf clean allTo completely clear cached metadata and transaction logs:Bashsudo dnf clean expire-cache - APT (Ubuntu / Linux Mint / Debian): To clear the local archive cache of downloaded
.debfiles:Bashsudo apt cleanTo remove older package versions that can no longer be downloaded:Bashsudo apt autoclean
Managing Software Repositories
1. Red Hat Ecosystem (DNF / YUM)
- Adding a Repository: You can add a repository by placing a
.repofile in/etc/yum.repos.d/, or by using the DNF config manager:Bashsudo dnf config-manager --add-repo https://example.com/example.repo - Enabling / Disabling a Repository:Bash
sudo dnf config-manager --set-enabled repository_name sudo dnf config-manager --set-disabled repository_name - Removing a Repository: Simply delete its corresponding configuration file from the repository directory:Bash
sudo rm /etc/yum.repos.d/unwanted-repo.repo
2. Debian Ecosystem (APT)
- Adding a PPA or Repository:Bash
sudo add-apt-repository ppa:example/ppa sudo apt update - Removing a Repository:Bash
sudo add-apt-repository --remove ppa:example/ppa sudo apt updateAlternatively, edit or remove source entries manually in/etc/apt/sources.listor/etc/apt/sources.list.d/.
Part 3: Graphical User Interface (GUI) Package Managers
For users who prefer point-and-click software management over terminal commands, every major Linux distribution includes robust graphical app stores and package managers.
1. Fedora Workstation: GNOME Software
- Overview: Fedora utilizes GNOME Software as its primary graphical application store.
- Capabilities: You can browse, search, install, and update applications, manage Flatpak repositories, and handle local package integrations seamlessly without touching the terminal.
- Launch: Search for Software in your application overview.
2. Ubuntu and Pop!_OS: Ubuntu Software / App Center
- Overview: Ubuntu features a snap-and-deb integrated application store (branded as Ubuntu Software or App Center depending on the version).
- Capabilities: Provides a curated app catalog, user reviews, one-click updates for system packages, and management of Snap packages alongside native
.debsoftware. - Launch: Click the orange Ubuntu Software / App Center icon on the dock.
3. Linux Mint: Software Manager
- Overview: Linux Mint features its own native Software Manager, widely praised for being fast, lightweight, and pulling user reviews and screenshots directly from software mirrors.
- Capabilities: Installs native packages, manages Flatpaks, lists application sizes, and details categories cleanly.
- Launch: Open the application menu and select Software Manager.
4. RHEL and CentOS: GNOME Software / PackageKit
- Overview: Enterprise systems typically disable heavy desktop application stores by default to conserve server resources, but on desktop installations, GNOME Software or PackageKit can be installed.
- Command to install GNOME Software (if missing):Bash
sudo dnf install gnome-software
Part 4: Cross-Format Package Conversion (Alien Tool)
Occasionally, you may find software distributed only as a .deb package when you are running Fedora, or vice-versa. You can convert between package formats using a utility called alien.
⚠️ Important Caveat: Converting between .deb and .rpm may not always work. Alien only translates the archive format and file structure; it cannot rewrite internal scripts, library dependency names, or core architecture paths if they differ fundamentally between Debian and Red Hat systems. Use conversion only as a last resort.
Installing Alien
- On Fedora / RHEL / CentOS:Bash
sudo dnf install alien - On Ubuntu / Linux Mint / Debian:Bash
sudo apt install alien
Converting and Installing Packages
- Converting
.debto.rpm(for Fedora/RHEL):Bashsudo alien -r package_name.debThis generates a corresponding.rpmfile which you can then install viasudo dnf install. - Converting
.rpmto.deb(for Ubuntu/Debian):Bashsudo alien -d package_name.rpmThis generates a.debpackage installable viasudo apt install.
Part 5: Comprehensive DNF & RPM Command Reference (Fedora, RHEL, CentOS)
Understanding Shell Wildcards
*(Asterisk): Matches any number of characters.?(Question mark): Matches exactly one character.
DNF Commands
- Install a package:
sudo dnf install tito - Install via wildcard prefix:
sudo dnf install tito* - Install matching a substring:
sudo dnf install *tito* - Install a local package with dependency resolution:
sudo dnf install ~/Downloads/package.rpm - Remove packages using wildcards:
sudo dnf remove virtualbox* - View installed packages:
dnf list installedor search:dnf list installed "*tito*" - Check package availability:
dnf list available "virtualbox*" - Find which package provides a file:
dnf provides ifconfig
RPM Commands (Local Management)
- Install a local package with progress indicators:
sudo rpm -ivh package.rpm - Install all packages in a directory:
sudo rpm -ivh *.rpm - Update an existing package:
sudo rpm -uvh package.rpm - Remove/Erase a package:
sudo rpm -e package_name - List all files installed by a package:
sudo rpm -ql chromium
Part 6: Comprehensive APT & DPKG Command Reference (Ubuntu, Linux Mint, Debian)
- Update local repository index:
sudo apt update - Install a package:
sudo apt install git - Install a local
.debfile via APT:sudo apt install ./package.deb - Remove a package (keeping configs):
sudo apt remove package_name - Purge a package (removing configs):
sudo apt purge package_name - Upgrade all system software:
sudo apt upgrade - Low-level install (
.deb):sudo dpkg -i package.deb - Fix broken dependencies post-dpkg:
sudo apt install -f - List files installed by a DEB package:
dpkg -L package_name