APT command equivalents on Fedora with DNF
APT is the package manager/dependency solver for the Debian ecosystem,
i.e. it manages .deb
packages installed by the DPKG program. Fedora
software is based on .rpm
packages, and thus uses DNF, the package
manager/dependency solver for the RPM program, instead. This document gives
a brief overview of the most common APT commands one might find in tutorials
and their DNF equivalents.
APT vs. DNF commands
APT command | DNF command | notes |
---|---|---|
|
|
This command is rarely needed, as dnf updates its package cache automatically when it is stale. A cache update can be forced by appending |
|
|
|
|
|
While |
|
|
|
|
--- |
|
|
|
|
|
|
With the exception of the distribution upgrade working differently and DNF updating the cache automatically, the commands are very similar. More info on DNF can be found here.
Why is APT in the Fedora repositories?
APT can not be used to install packages on Fedora, you have to use DNF instead. |
The apt
command on Fedora used to - until
Fedora
32 - actually be APT-RPM, which basically mapped normal apt commands so
that they worked with Fedora’s RPM package management system.
However, APT-RPM is unmaintained, broken & insecure, and so was dropped in
favour of shipping the actual Debian APT software. Since APT exclusively
deals with .deb
packages, the apt
command can no longer be used to
manage Fedora packages. Its purpose is now purely as a tool for people
building packages for Debian-based distributions on a Fedora system.