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
Task | Command |
---|---|
Update package lists | sudo apt update |
Upgrade installed packages | sudo apt upgrade |
Install a package | sudo apt install <package> |
Remove a package | sudo apt remove <package> |
Remove unnecessary dependencies | sudo apt autoremove |
Search for a package | apt search <package> |
Show package info | apt show <package> |
List installed packages | dpkg -l |
RPM-based (DNF/YUM)
Distributions: Fedora, RHEL, CentOS, Rocky Linux, AlmaLinux
Task | DNF Command | YUM Command |
Update package lists | sudo dnf check-update | sudo yum check-update |
Upgrade installed packages | sudo dnf upgrade | sudo yum update |
Install a package | sudo dnf install <package> | sudo yum install <package> |
Remove a package | sudo dnf remove <package> | sudo yum remove <package> |
Remove unused dependencies | sudo dnf autoremove | sudo yum autoremove |
Search for a package | dnf search <package> | yum search <package> |
Show package info | dnf info <package> | yum info <package> |
List installed packages | dnf list installed | yum list installed |
Arch-based (Pacman)
Distributions: Arch Linux, Manjaro, EndeavourOS
Task | Command |
Update package lists and system | sudo pacman -Syu |
Install a package | sudo pacman -S <package> |
Remove a package | sudo pacman -R <package> |
Remove package and dependencies | sudo pacman -Rns <package> |
Search for a package | pacman -Ss <package> |
Show package info | pacman -Si <package> |
List installed packages | pacman -Qe |
openSUSE (Zypper)
Distributions: openSUSE Leap, openSUSE Tumbleweed
Task | Command |
Refresh repositories | sudo zypper refresh |
Upgrade installed packages | sudo zypper update |
Install a package | sudo zypper install <package> |
Remove a package | sudo zypper remove <package> |
Search for a package | zypper search <package> |
Show package info | zypper info <package> |
List installed packages | zypper se --installed-only |
Gentoo (Portage – emerge)
Distributions: Gentoo
Task | Command |
Sync repositories | sudo emerge --sync |
Update installed packages | sudo emerge -uD @world |
Install a package | sudo emerge <package> |
Remove a package | sudo emerge --deselect <package> |
Search for a package | emerge --search <package> |
Show package info | emerge --info <package> |
List installed packages | equery list |
Slackware (pkgtools, slapt-get, sbopkg)
Distributions: Slackware
Task | Command |
Install a package | installpkg <package>.txz |
Remove a package | removepkg <package> |
Upgrade a package | upgradepkg <package>.txz |
Search for a package | slapt-get --search <package> |
Install from SlackBuilds | sbopkg -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
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…
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…
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…