Operations 7 min read

Master Linux Package Management: Essential Commands for Debian, RPM, and More

This guide walks you through the fundamentals of Linux package management across major distributions, covering repository updates, package searches, installations, upgrades, and removals using tools like APT, yum, and dnf, with practical command examples and visual references.

ITPUB
ITPUB
ITPUB
Master Linux Package Management: Essential Commands for Debian, RPM, and More

Brief Overview of Linux Package Management

Modern Unix-like operating systems provide centralized package managers that let users search, install, upgrade, and remove software stored in repositories. Packages typically consist of binaries, scripts, metadata, and documentation.

Common Package Formats and Tools

Debian, Ubuntu, Linux Mint, and Raspbian use .deb packages managed with apt; direct .deb installation uses dpkg. CentOS, Fedora, and Red Hat use RPM packages managed with yum, which newer Fedora releases replace with dnf.

Updating the Local Package Database

Before installing or upgrading, refresh the local cache of available packages. Examples:

sudo apt update
sudo yum makecache
sudo dnf makecache

Upgrading Installed Packages

Keep software up‑to‑date with a few commands:

sudo apt upgrade
sudo yum update
sudo dnf upgrade

Searching for Packages

Command‑line search is preferred for efficiency:

apt search <package>
yum search <package>
dnf search <package>

Viewing Package Information

Before installing, inspect details such as version and dependencies:

apt show <package>
yum info <package>
dnf info <package>

Installing Packages from Repositories

Once the package name is known, install it directly from the repository:

sudo apt install <package>
sudo yum install <package>
sudo dnf install <package>

Installing Packages from Local Files

When you have a downloaded package file, install it without a repository:

Debian/Ubuntu: sudo dpkg -i <file.deb> RPM‑based: sudo yum localinstall <file.rpm> or

sudo dnf install <file.rpm>

Removing Packages

The package manager tracks which files belong to each package, allowing clean removal:

sudo apt remove <package>
sudo yum remove <package>
sudo dnf remove <package>
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxAPTpackage managementRPM
ITPUB
Written by

ITPUB

Official ITPUB account sharing technical insights, community news, and exciting events.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.