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 web server setup

How to Set Up a Linux Web Server: A Complete Step-by-Step Guide

In today’s digital world, a web server is essential for hosting websites, applications, and online s…

top 5 operating systems for raspberry pi

The Top 5 Operating Systems for Raspberry Pi in 2025

The Raspberry Pi is one of the most beloved tools in the world of DIY computing, electronics, and pr…

top 15 linux distros

The Top 15 Linux Distros in 2025 – What’s Hot Right Now?

Curious about which Linux distributions are leading the pack in 2025? Based on the latest rankings f…