DNF and its APT command equivalents on Fedora
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 therefore 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 compared to DNF commands
| APT command | DNF command | notes |
|---|---|---|
|
|
Of course, actual package names may vary. For example, |
|
|
Updates only already installed package and its dependencies. The |
|
|
This command is rarely needed, as dnf updates its package cache automatically when it is stale. A cache update can be forced by appending |
|
|
Note that while |
|
|
While |
|
|
|
|
--- |
Fedora packages do not treat configuration files in the same way as Debian packages, so there is no direct equivalent. |
|
|
Note that this can occasionally remove packages that you might actually want. Use |
|
|
|
Con las excepciones de que la actualización de distribución trabaja de modo diferente y la actualización de la caché DNF automática, los comandos son muy similares. Más información sobre DNF se puede encontrar aquí.
Why is APT in the Fedora repositories
| APT no puede ser usada para instalar paquetes sobre Fedora, tiene que usar DNF en su lugar. |
The apt command on Fedora used to — until Fedora 32 — actually be APT-RPM, which mapped normal apt commands so that they worked with Fedora’s RPM package management system.
Sin embargo, no está mantenido APT-RPM, roto, e inseguro, y no fue abandonado en favor de llevar el software actual de Debian APT. Desde tratos exclusivamente de APT con paquetes .deb, el comando apt no puede ser utilizado más para gestionar paquetes de Fedora. Su propósito ahora es puramente como una herramienta para gente que construya paquetes para distribuciones basándose en Debian en un sistema Fedora.
Want to help? Learn how to contribute to Fedora Docs ›