The essentials
Quick reference
One focused task per row. Jump to the related section for complete, working examples.
| Use | Syntax | Examples |
|---|---|---|
| Search APT packages | apt search --names-only nginx | View examples |
| Inspect APT metadata | apt show nginx | View examples |
| Search DNF packages | dnf search nginx | View examples |
| Inspect DNF metadata | dnf info nginx | View examples |
| Refresh APT indexes | sudo apt update | View examples |
| Upgrade APT packages | sudo apt upgrade | View examples |
| Install with APT | sudo apt install nginx | View examples |
| Check DNF updates | dnf check-upgrade | View examples |
| Upgrade with DNF | sudo dnf upgrade | View examples |
| Install with DNF | sudo dnf install nginx | View examples |
| Search Flatpak apps | flatpak search org.gnome.TextEditor | View examples |
| Install a Flatpak app | flatpak install flathub org.gnome.TextEditor | View examples |
| List package files | dpkg -L nginx | View examples |
| Verify RPM files | rpm -V nginx | View examples |
| Remove an APT package | sudo apt remove nginx | View examples |
| Inspect DNF transactions | dnf history list | View examples |
Package managers resolve software, dependencies, signatures, and lifecycle state from configured repositories. Refresh metadata before interpreting availability, inspect the proposed transaction, avoid mixing repositories casually, and keep a recovery path for remote or boot-critical upgrades.
Step by step
Detailed examples
Resolve exact package identity and origin
Search results can include similarly named or third-party packages. Inspect version, architecture, repository, dependencies, and signing configuration before installation. Distribution package names differ, so do not translate commands without rechecking the target OS.
apt search --names-only nginx
apt show nginx
# On DNF systems:
dnf search nginx
dnf info nginx Separate metadata refresh from upgrades
apt update refreshes indexes; it does not upgrade installed software. apt upgrade proposes changes and prompts before applying them, while full-upgrade may remove packages to resolve dependency changes. Read removals, new services, conffile prompts, and restart notices before accepting.
sudo apt update
apt list --upgradable
apt --simulate install nginx
sudo apt install nginx Note: The final command changes the system; inspect the simulation and interactive proposal first.
Use DNF history as part of change control
DNF refreshes metadata according to cache policy and shows a transaction summary before confirmation. check-upgrade uses an exit status that scripts must handle. History records package transactions, but undo may fail when old packages are no longer available or database migrations are irreversible.
dnf check-upgrade || status=$?
dnf upgrade --assumeno
sudo dnf upgrade
dnf history info last Note: Treat check-upgrade status 100 as updates available rather than a generic failure.
Address applications by remote and ID
Flatpak separates system and per-user installations and uses application IDs rather than distribution package names. Inspect requested permissions and remote origin. Runtimes are shared dependencies; unused cleanup should be reviewed rather than automated blindly.
flatpak remotes --show-details
flatpak search TextEditor
flatpak remote-info flathub org.gnome.TextEditor
flatpak install flathub org.gnome.TextEditor Verify ownership and removal consequences
dpkg -L and rpm -ql show packaged paths; local state and generated files may not belong to the package database. Verification reports metadata differences but does not automatically prove compromise. Removing software may stop shared services or orphan data; back up and review reverse dependencies first.
dpkg -L nginx
# Resolve one path on Debian-family systems:
dpkg -S /usr/sbin/nginx
# RPM-family equivalents:
rpm -ql nginx
rpm -V nginx Sources and further reading
References
Authoritative documentation used to verify and expand this cheat sheet.
Help us improve
Found a typo or missing example?
Tell us what would make this cheat sheet clearer, more complete, or more useful.



