Linux Package Management: A Guide to apt, dnf, and pacman

📆 · ⏳ 2 min read · ·

Introduction

Linux is an open-source operating system with several distributions, each with its own package management system. A package management system is responsible for installing, updating, and removing software packages.

Linux has multiple package managers, and each has its own set of commands and utilities. In this article, we’ll cover three of the most popular package managers: apt, dnf, and pacman.

Overview of Package Managers

apt (Advanced Package Tool)

apt is a package manager used in Debian and Ubuntu distributions. It is a command-line utility that uses a repository-based system to manage software packages.

The apt package manager uses .deb files to install packages, and it provides many features such as package installation, upgrade, and removal, dependency handling, and source package management.

For instance, to install a package using apt, the command is sudo apt install package_name.

dnf (Dandified yum):

dnf is the default package manager in Fedora, Red Hat, and CentOS. It is a fork of the yum package manager and is designed to improve performance and usability.

dnf uses a repository-based system similar to apt, and it installs packages using .rpm files.

dnf provides features such as dependency resolution, package installation, upgrade, and removal. For example, to install a package using dnf, the command is sudo dnf install package_name.

pacman

pacman is the package manager used in Arch Linux and its derivatives. It is a command-line utility that installs and manages packages from a repository-based system.

pacman uses .pkg.tar.xz files to install packages and provides features such as package installation, upgrade, removal, and dependency resolution.

For instance, to install a package using pacman, the command is sudo pacman -S package_name.

Conclusion

Linux package management can be complicated, but understanding the basics of the three package managers, apt, dnf, and pacman, can help you get started.

Each package manager has its own features and commands, but they all use a repository-based system to install, update, and remove software packages.

Learning the package management system of your Linux distribution will enable you to manage software packages effectively.

You may also like

  • # linux

    Mount a drive permanently with fstab in Linux

    Let's see how to mount a drive permanently in Linux using the fstab file which will mount the drive automatically on boot.

  • # linux# homelab# selfhosted

    Setup Jellyfin with Hardware Acceleration on Orange Pi 5 (Rockchip RK3558)

    Recently I moved my Jellyfin to an Orange Pi 5 Plus server. The Orange Pi 5 has a Rockchip RK3558 SoC with integrated ARM Mali-G610. This guide will show you how to set up Jellyfin with hardware acceleration on the Orange Pi 5.

  • # linux# homelab

    HTTPS with self-signed certificates for your Homelab services

    In this article we will deep dive into understanding how we can setup HTTPS with self-signed certificates for our Homelab services.This is often required when you are running your own services and you want to access them over HTTPS.