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

Linux Terminal Tips

25 Practical Linux Terminal Tips and Tricks You’ll Actually Use (2026 Guide)

Why Learning the Linux Terminal Still Matters Linux Terminal Tips and TricksEven in 2026, the Linux …

automatic disk cleanup in Linux

How to Automatically Clean Disk Space in Linux (Set Up Smart Auto-Cleanup in Minutes)

If your Linux system keeps running out of disk space, you’re not alone. Over time, cached packages, …

Swap Virtual Memory

How to Add Swap Virtual Memory in Linux for Better Performance (Without Losing Data)

Running out of memory on a Linux system can slow everything down—or even crash your applications. If…