The essentials

Quick reference

One focused task per row. Jump to the related section for complete, working examples.

UseSyntaxExamples
Search APT packagesapt search --names-only nginxView examples
Inspect APT metadataapt show nginxView examples
Search DNF packagesdnf search nginxView examples
Inspect DNF metadatadnf info nginxView examples
Refresh APT indexessudo apt updateView examples
Upgrade APT packagessudo apt upgradeView examples
Install with APTsudo apt install nginxView examples
Check DNF updatesdnf check-upgradeView examples
Upgrade with DNFsudo dnf upgradeView examples
Install with DNFsudo dnf install nginxView examples
Search Flatpak appsflatpak search org.gnome.TextEditorView examples
Install a Flatpak appflatpak install flathub org.gnome.TextEditorView examples
List package filesdpkg -L nginxView examples
Verify RPM filesrpm -V nginxView examples
Remove an APT packagesudo apt remove nginxView examples
Inspect DNF transactionsdnf history listView 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

01

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.

Identify package candidates
apt search --names-only nginx
apt show nginx
# On DNF systems:
dnf search nginx
dnf info nginx
Back to quick reference ↑
02

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.

Review an APT transaction
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.

Back to quick reference ↑
03

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.

Review a DNF upgrade
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.

Back to quick reference ↑
04

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.

Inspect before installation
flatpak remotes --show-details
flatpak search TextEditor
flatpak remote-info flathub org.gnome.TextEditor
flatpak install flathub org.gnome.TextEditor
Back to quick reference ↑
05

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.

Inspect package footprint and ownership
dpkg -L nginx
# Resolve one path on Debian-family systems:
dpkg -S /usr/sbin/nginx
# RPM-family equivalents:
rpm -ql nginx
rpm -V nginx
Back to quick reference ↑

Sources and further reading

References

Authoritative documentation used to verify and expand this cheat sheet.

  1. Debian ProjectAPT User's Guidedebian.org
  2. Debian Projectapt(8)manpages.debian.org
  3. DNF ProjectDNF Command Referencednf.readthedocs.io
  4. Flatpak ProjectFlatpak Command Referencedocs.flatpak.org

Help us improve

Found a typo or missing example?

Tell us what would make this cheat sheet clearer, more complete, or more useful.

Share feedback