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!

check linux kernel

How to Check the Kernel Version of a Linux System

The Linux kernel is the core of any Linux-based operating system, managing hardware and system resou…

reactos

ReactOS: A Free and Open-Source Windows-Compatible Operating System

ReactOS is a unique operating system that aims to provide a free and open-source alternative to Micr…

AI Operating System

OpenDAN: Your Personal Open-Source AI Operating System

In the rapidly evolving landscape of artificial intelligence (AI), the demand for personalized and p…