My personal notes that I use when trying to debug package issues on Fedora. Knowing what you are doing is always preferable to entering commands from StackExchange as root user.
1. The actual docs
It's never a bad idea to RTFM. https://docs.fedoraproject.org/en-US/quick-docs/dnf/
2. General debugging
See a list of previous actions:
dnf history
See a list of user packages
dnf history userinstalled
Another approach:
sudo dnf repoquery --userinstalled
3. Get current Fedora release number
$ cat /etc/fedora-release
4. List available versions of a package
List versions of a package, which you could install right now:
dnf list --showduplicates $PACKAGE_NAME
Sometimes, new versions of a package are only available on a recent release. To check which versions are available on a different release, use:
dnf --releasever=29 --showduplicates list $PACKAGE_NAME
5. Upgrade to a different Fedora release
- Upgrades are tested from the previous 2 releases. So, for example, if you are on 35 and want 39, you should go from 35 -> 37 -> 39.
- Backups are a good idea before an upgrade
# Update DNF sudo dnf --refresh upgrade # Get the dnf system upgrade plugin sudo dnf install dnf-plugin-system-upgrade --best # Download the fedora 37 release sudo dnf system-upgrade download --refresh --releasever=37 # Do upgrade and reboot sudo dnf system-upgrade reboot
6. Get package that provides a command
Use dnf provides
to look up a package associated with a given command.
dnf provides [command]
7. List files associated with a package
This is equivalent to finding where a package is installed.
dnf repoquery -l [Package]