Fedora command cheat sheet (F45-ready)
One page of commands. Everything follows the actual F45 / dnf5 5.4 argument shapes — dnf5 is not compatible with dnf4 on several subcommands, and the ones that break when copied are listed at the end.
1. Identity and versions
Section titled “1. Identity and versions”cat /etc/os-release # release and variantrpm -q rpm dnf5 kernel # key component versionsuname -r # kernelhostnamectl # host overviewOn F45, rpm -q rpm should report rpm-6.1.x; if it still says 6.0.x, you are on F44.
2. Packages and queries
Section titled “2. Packages and queries”| Goal | Command |
|---|---|
| Install | sudo dnf install <pkg> |
| Search | dnf search <term> |
| Find the package owning a file | dnf provides '*/libssl.so.3' |
| Package details | dnf info <pkg> |
| List installed | dnf list --installed |
| Remove | sudo dnf remove <pkg> |
| Install a local file | sudo dnf install ./x.rpm (warns only — see the signature page) |
| Build dependencies from a spec | sudo dnf builddep x.spec |
| Mark as user-installed | sudo dnf mark install <pkg> |
| Groups | sudo dnf group install '<name>' |
| Swap one package for another | sudo dnf swap <old> <new> |
3. Repositories
Section titled “3. Repositories”dnf repolist # enabled onlydnf repolist --all # includes disabled (use this to copy repo IDs)dnf repoinfo <id> # effective enabled / gpgcheck for one reposudo dnf --enablerepo=<id> install <pkg> # enable for one commandsudo dnf config-manager setopt <id>.enabled=0 # disable persistentlysudo dnf config-manager addrepo --from-repofile=<url>sudo dnf clean all && sudo dnf makecacheThe F45 location changes (the easiest thing to trip over):
| Item | F44 and earlier | F45 |
|---|---|---|
| Packaged repositories | /etc/yum.repos.d | /usr/share/dnf5/repos.d |
| GPG keys | /etc/pki/rpm-gpg | /usr/share/pki/rpm-gpg |
| Custom repositories | /etc/yum.repos.d | unchanged |
| Override file | — | /etc/dnf/repos.override.d/99-config_manager.repo |
ls /usr/share/dnf5/repos.d/rpm -qf /usr/share/dnf5/repos.d/fedora.repo # if it names a package, do not edit by handSee repository configuration moves to /usr.
4. Updates and security
Section titled “4. Updates and security”sudo dnf upgrade --refresh # refresh metadata and upgradesudo dnf updateinfo list --updates # pending security and bugfix updatessudo dnf needs-restarting # is a reboot neededsudo dnf distro-sync # align to the current repository versionsdnf history list # transaction historysudo dnf history undo <id> # roll back one transactionMeasured needs-restarting output:
No core libraries or services have been updated since boot-up.Reboot should not be necessary.5. Signatures
Section titled “5. Signatures”rpm -K pkg.rpm # check signature and digestsrpm -qpi pkg.rpm | head -10 # package metadatasudo rpm --import RPM-GPG-KEY-fedora # import a public keyrpm --addsign pkg.rpm # sign a packagesudo rpm -i --nosignature pkg.rpm # allow one unsigned packageSince F45, rpm 6.1 enforces signatures: rpm -i refuses unsigned packages, dnf from a repository refuses too, and dnf install ./x.rpm only warns. See signature enforcement.
6. Release upgrades
Section titled “6. Release upgrades”sudo dnf upgrade --refresh # bring the current release up to date firstsudo dnf system-upgrade download --releasever=45 # download the new releasesudo dnf system-upgrade reboot # reboot into the offline transactionsudo dnf system-upgrade clean # clean the download cacheRecovering from a failed upgrade is in troubleshooting a failed upgrade; version-specific steps are in upgrading to Fedora 45.
7. Containers and isolation
Section titled “7. Containers and isolation”sudo dnf install toolbox # Cloud/Server need this manuallytoolbox create [name] # create a containertoolbox enter [name] # enter ittoolbox run <cmd> # run without enteringtoolbox list # listtoolbox rm <name> # removepodman version && podman info # version and backendspodman ps -a # including stopped containerspodman imagespodman run --rm -it fedora:45 bashflatpak remotes # connected application sourcesflatpak list --app8. Troubleshooting entry points
Section titled “8. Troubleshooting entry points”systemctl status <unit> --no-pagerjournalctl -b -u <unit> --no-pager | tail -50journalctl -p err -b --no-pager | tail -30lsblk -o NAME,SIZE,FSTYPE,MOUNTPOINTSdf -h / /var /bootcat /sys/class/vtconsole/*/name # console backendFor matching error text, see error lookup.
9. dnf5 versus dnf4 (the ones that break when copied)
Section titled “9. dnf5 versus dnf4 (the ones that break when copied)”| dnf4 form | Result on dnf5 | Use instead |
|---|---|---|
dnf updateinfo --summary | Unknown argument | updateinfo list --updates |
dnf updateinfo --list | Unknown argument | updateinfo list |
dnf config-manager --add-repo | argument does not exist | config-manager addrepo --from-repofile= |
dnf repoquery --requires | works, different output format | check --help first |
dnf groupinstall | does not exist | dnf group install |
10. Services and systemd
Section titled “10. Services and systemd”systemctl status <unit> --no-pager # one servicesystemctl list-units --failed # services that failed this bootsystemctl list-unit-files | grep <term> # does the unit existsudo systemctl enable --now <unit> # enable at boot and start nowsudo systemctl disable --now <unit> # disable and stopsudo systemctl mask <unit> # block entirely (stronger than disable)sudo systemctl unmask <unit>systemctl cat <unit> # the unit file itselfsystemctl show <unit> -p LoadState -p ActiveStatesystemctl list-timers --all # scheduled jobs (the cron replacement)journalctl -b -1 -p err --no-pager | tail -30 # errors from the previous boot11. Storage and filesystems
Section titled “11. Storage and filesystems”lsblk -o NAME,SIZE,FSTYPE,MOUNTPOINTS,UUIDdf -h / /var /bootdf -i /var # exhausted inodes also read as "no space"du -xh --max-depth=1 /var | sort -h | tail -10findmnt # all mount relationshipssudo mount -o remount,rw / # make a read-only root writable temporarilysudo fsck -n <device> # read-only check12. Networking and DNS
Section titled “12. Networking and DNS”ip -br addr # addresses at a glanceip route # routing tablenmcli dev status # devices and connection statenmcli con show # connection names (case sensitive)nmcli con up <name>getent hosts <name> # resolution only, not connectivitycat /etc/resolv.confss -tlnp # listening sockets and processessudo firewall-cmd --state # only if firewalld is installedsudo firewall-cmd --list-allping -c1 <IP> # test IP before names13. Containers and Toolbox (continued)
Section titled “13. Containers and Toolbox (continued)”podman ps -a # including stoppedpodman logs <container>podman exec -it <container> bashpodman inspect <container> | head -20podman system df # space used by images and containerspodman system prune -a # cleanup (use with care)systemctl --user daemon-reload # required after editing a Quadletsystemctl --user list-unit-files "*.service" | grep generatedloginctl enable-linger $USER # keep containers running after logout14. Users, permissions and SELinux
Section titled “14. Users, permissions and SELinux”id # your uid/gid and groupsgetent passwd <user>sudo useradd -m -G wheel <user>sudo passwd <user>sudo usermod -aG wheel <user> # append to a group; do not drop -asudo -l # what the current user may dols -lZ <path> # permissions plus SELinux labelsgetenforce # Enforcing / Permissivesudo ausearch -m AVC -ts recent # recent denialssudo restorecon -Rv <path> # restore default labels15. Logs and troubleshooting
Section titled “15. Logs and troubleshooting”journalctl -b --no-pager | tail -50journalctl -p err -b --no-pager | tail -30journalctl -u <unit> -f # follow one servicejournalctl --disk-usagesudo journalctl --vacuum-size=500Mjournalctl -k -b | tail -30 # kernel onlydmesg -T | tail -30 # with human-readable timestampscat /sys/class/vtconsole/*/name # which console backend is bound16. A health snapshot for the machine
Section titled “16. A health snapshot for the machine”Run it before and after upgrading; the diff is exactly “what this changed”:
#!/bin/bashecho "== $(grep VERSION_ID /etc/os-release)"echo "kernel: $(uname -r)"for p in systemd glibc python3 openssl dnf5 rpm podman kmscon; do printf "%-10s %s\n" "$p" "$(rpm -q --qf '%{VERSION}-%{RELEASE}' "$p" 2>/dev/null || echo '-')"doneecho "repos: /usr=$(ls /usr/share/dnf5/repos.d/*.repo 2>/dev/null | wc -l) /etc=$(ls /etc/yum.repos.d/*.repo 2>/dev/null | wc -l)"echo "failed units: $(systemctl --failed --no-legend | wc -l)"The full comparison is in the version matrix.
Related pages
Section titled “Related pages”- Users and permissions — accounts and sudo
- SSH service and keys — sshd config and keys
- systemd services and timers — units, timers and failure debugging
- firewalld — zones and openings
- SELinux — modes, contexts, booleans
- Networking and nmcli — addressing, routing, DNS
- Storage and btrfs — subvolumes and capacity
- Version matrix — components and behaviour, F44 versus F45
- Error lookup — exact message → cause → fix
- Fedora repositories and dnf5 — full repository operations
- Moving from dnf to dnf5 — migration details
- Signature enforcement — the three signature paths
- Fedora 45: changes, download and upgrade — release overview