APT

  • APT stands for Advanced Packaging Tool
  • apt works with packages in the .deb format
  • apt is the front-end of dpkg (Debian Package Manager)
  • apt needs manual updating of the repo lists
  • apt is used in Debian and all its derivatives like Ubuntu, Linux Mint, etc.
  • Faster than dnf on tests to resolve dependencies and install packages
  • It cannot download and install from URLs directly, it needs .deb packages
  • It supports one-click install

DNF

  • DNF stands for Dandified Yum
  • dnf works with packages in .rpm format
  • dnf is the front-end of RPM (Red Hat Package Manager)
  • dnf updates the repo lists automatically
  • dnf is used in RHEL, Fedora, CentOS and other derivatives of RHEL
  • Slower than apt on tests to resolve dependencies and install packages
  • It can download and install from URLs directly
  • It doesn’t support one-click installs

Command Equivalents

APTDNF
apt installdnf install
apt listdnf list
apt searchdnf search
apt removednf remove
apt updatednf check-update / dnf upgrade –refresh
apt upgradednf upgrade
apt install –only-upgrade packagednf update package
apt full-upgradednf distro-sync / dnf system-upgrade
apt purge
apt autoremovednf autoremove
apt show (shows app info)dnf info
apt show (shows app list)dnf deplist

References:

  1. https://docs.fedoraproject.org/en-US/quick-docs/dnf/
  2. https://docs.fedoraproject.org/en-US/quick-docs/dnf-vs-apt/
  3. https://dnf.readthedocs.io/en/latest/command_ref.html
  4. https://www.digitalocean.com/community/tutorials/package-management-basics-apt-yum-dnf-pkg
  5. https://embeddedinventor.com/dnf-vs-apt-similarities-and-differences-analyzed/