Skip to content

Linux Package Management Cheatsheet

  • by

Package management is a crucial part of administering a Linux system. Different distributions use different package managers, each with its own commands. Here’s a quick reference for the most commonly used package management tools across popular distributions.


Debian-based (APT – Advanced Packaging Tool)

Distributions: Debian, Ubuntu, Linux Mint, Pop!_OS

TaskCommand
Update package listssudo apt update
Upgrade installed packagessudo apt upgrade
Install a packagesudo apt install <package>
Remove a packagesudo apt remove <package>
Remove unnecessary dependenciessudo apt autoremove
Search for a packageapt search <package>
Show package infoapt show <package>
List installed packagesdpkg -l

RPM-based (DNF/YUM)

Distributions: Fedora, RHEL, CentOS, Rocky Linux, AlmaLinux

TaskDNF CommandYUM Command
Update package listssudo dnf check-updatesudo yum check-update
Upgrade installed packagessudo dnf upgradesudo yum update
Install a packagesudo dnf install <package>sudo yum install <package>
Remove a packagesudo dnf remove <package>sudo yum remove <package>
Remove unused dependenciessudo dnf autoremovesudo yum autoremove
Search for a packagednf search <package>yum search <package>
Show package infodnf info <package>yum info <package>
List installed packagesdnf list installedyum list installed

Arch-based (Pacman)

Distributions: Arch Linux, Manjaro, EndeavourOS

TaskCommand
Update package lists and systemsudo pacman -Syu
Install a packagesudo pacman -S <package>
Remove a packagesudo pacman -R <package>
Remove package and dependenciessudo pacman -Rns <package>
Search for a packagepacman -Ss <package>
Show package infopacman -Si <package>
List installed packagespacman -Qe

openSUSE (Zypper)

Distributions: openSUSE Leap, openSUSE Tumbleweed

TaskCommand
Refresh repositoriessudo zypper refresh
Upgrade installed packagessudo zypper update
Install a packagesudo zypper install <package>
Remove a packagesudo zypper remove <package>
Search for a packagezypper search <package>
Show package infozypper info <package>
List installed packageszypper se --installed-only

Gentoo (Portage – emerge)

Distributions: Gentoo

TaskCommand
Sync repositoriessudo emerge --sync
Update installed packagessudo emerge -uD @world
Install a packagesudo emerge <package>
Remove a packagesudo emerge --deselect <package>
Search for a packageemerge --search <package>
Show package infoemerge --info <package>
List installed packagesequery list

Slackware (pkgtools, slapt-get, sbopkg)

Distributions: Slackware

TaskCommand
Install a packageinstallpkg <package>.txz
Remove a packageremovepkg <package>
Upgrade a packageupgradepkg <package>.txz
Search for a packageslapt-get --search <package>
Install from SlackBuildssbopkg -i <package>

Other Package Managers

  • Flatpak: flatpak install <package> (Universal package format for Linux)
  • Snap: snap install <package> (Canonical’s universal package manager)
  • AppImage: Run with ./<AppImageFile> (No installation needed)

This cheatsheet provides essential commands for managing packages across various Linux distributions. Whether you use Debian-based, RPM-based, Arch, or others, knowing the right commands makes Linux administration more efficient!

For Tech News – visit Gee-Tech.com

SELinux

SELinux Demystified: A Deep Dive into Kernel-Level Security 2025

Security-Enhanced Linux (SELinux) is one of the most powerful—and often misunderstood—security mecha…

send email from the linux terminal

Send Email from the Linux Terminal Command Line

For many system administrators, developers, and Linux power users, the command line remains the most…

almalinux 10 vs ubuntu 24.04 lts

AlmaLinux 10 vs Ubuntu 24.04 LTS for hosting

Here’s how AlmaLinux 10 stacks up against Ubuntu 24.04 LTS for VPS hosting—focusing on stability and…