What is a Package Manager?


In learning Linux, there are many ways to start, most typically start with things like the command line, which is good, it should be learned and used, but arguably, the most important aspect of running Linux, and any Linux distro, and at times, why a Linux distro maybe liked more than another, is the Package Manager. The general concept of a Package Manager, while obvious in name, may be foreign to some, especially those unfortunate dark souls coming from Windows.

In Linux, you will use the package manager for the most important tasks of installing and updating software, this is how you will maintain your system in some form or another. While most all of the same software is available on any Linux distro the Package Managers commands, names, structure, and many other things can vary heavily from one Linux distro to the next. This is by no means a comprehensive document on Package Managers, but should give you some incite, which may play a role of you are still shopping for your first, or next, or last, Linux distro.

Therefore, while many say learn this or that first with Linux, one of the best things to learn first is the package manager of a Linux distro of interest. Learning one package manager, does very little to help when working with another, they are quite different, and this is where the core differences of most Linux distros reside. If you like, you can skip this page and go straight to Wikipedia.

Package Formats


Package managers tend to come with their own package formats, but not all of the package formats are different for every package manager. Some package managers use common formats, so there is a difference between a package format and a package manager. The format being the structure of how the package data is stored in binary or plain text.

.rpm


This is a binary format that originates from Red Hat and is used by several Linux distros such as Red Hat Enterprise Linux (RHEL), Fedora, SUSE, openSUSE, and some others. This is one of the most common formats and one of the ones used by Linux certifications. It can also be confusing as RPM is also the name of a package manager, the RPM package manager and the file format, RPM refers to both as stated on Wikipedia.

.deb


This is binary format that originates from Debian and is used by any Debian based Linux distro such as Ubuntu and some others. This is also one of the most common formats and one of the ones used by Linux certifications. This is just a file format that is well covered on Wikipedia.

.nix


This is a plain text format that originates from NixOS Linux and is used exclusively by NixOS. These files use the Nix build language package file format, that is used to build a package from source. For more information visit nixos.wiki/wiki/Nixpkgs

.ebuild


This is a plain text format that originates from Gentoo Linux and is used by Gentoo based distros and others such as ChromeOS. Ebuilds are glorified bash shell scripts that wrap existing build systems to compile packages from source. For more information visit wiki.gentoo.org/wiki/Ebuild.

.pkg.tar.xz


This is binary format, a xz-compressed tar archive, aka tarball, which can also come as .pkg.tar.zst for a zst-compressed tar archive. Tarballs are one of the most common forms of distributing software for any Unix or Linux system going back many decades, the compression various. The uncompressed structure inside follows the Arch Linux package format. For more information visit wiki.archlinux.org/title/Creating_packages

.txz


This is binary format, a xz-compressed tar archive, aka tarball, also represented as .tar.xz which can also come with many other compression formats as tar archive, most common legacy is tar.gz or tgz with gzip-compression. Tarballs are one of the most common forms of distributing software for any Unix or Linux system going back many decades, the compression various. The uncompressed structure inside will vary depending on the creator, but when used with Linux distros such as Slackware, will follow a very simply structure covered in slackbook.

Package Managers


Now for the meat, or for you vegans, veggies, and for you pescatarians, fish, and for the pesca-pescatarian, fish that have only eaten other fish; we finally get to the package managers themselves. Package managers and file formats are directly related, as a given package manager only works with a single package file format, at this time, there are no polyglot package managers, and again, this is why they are unique and what makes any Linux distro unique from another, with exceptions.

Things here, like many in the Linux world, get a little weird, as there are many "front-ends" to various package managers, and most times you can still use raw commands such as rpm, dpkg, and ebuild, which technically are package managers, but typically, most actions are invoked via some wrapper, or update manager as some are called, but are also called package managers. Most times, on any given distro, you do not have a choice on package managers, but the underlying package manager commands will be present regardless. If you do use a package manager or install packages manually, they will be unsupported by the Linux distro's community, which is perfectly acceptable and normal, just to be aware. Most times in FOSS, you are the support; go you!

DNF


DNF (abbreviation for Dandified YUM)is a package manager for Red Hat-based Linux distributions, derivatives, and parent Fedora and uses the rpm package format. This is the current Red Hat package manager and is a replacement for the previous package manager YUM still used on older releases. For more information visit en.wikipedia.org/wiki/DNF_(software).

YUM


The Yellowdog Updater Modified (YUM) is an automatic updater and package installer/remover for rpm package format systems. It automatically computes dependencies and figures out what things should occur to install packages. It makes it easier to maintain groups of machines without having to manually update each one using rpm. For more information visit yum.baseurl.org and en.wikipedia.org/wiki/Yum_(software).

RPM


Red Hat Package Manager (RPM) is one of the original package managers for the rpm package format, which it coined. While most Linux system that use this format do not use this package manager directly, it is still available via its direct command line invocation just as it always has been, but most are advised to use the respective current interface, DNF, YUM, ZYpp, etc. For more information visit rpm.org/ and en.wikipedia.org/wiki/RPM_Package_Manager.

ZYpp


ZYpp is the official package manager for SUSE and openSUSE and shockingly uses the rpm package format. Unlike some more basic package managers, it provides a satisfiability solver to compute package dependencies. For more information visit en.opensuse.org/Portal:Libzypp and en.wikipedia.org/wiki/ZYpp.

dpkg


dpkg is the official package manager for Debian and Debian-based derivatives such as Ubuntu and many others and uses the deb package format. This is one of the oldest package managers that is still in wide usage, but rarely do people use this package manager directly, like RPM, it tends to be invoked and wrapped by other package manager software. For more information visit www.dpkg.org and en.wikipedia.org/wiki/Dpkg.

apt


Advanced Package Tool (APT) is also the official package manager for Debian and Debian-based derivatives such as Ubuntu and many others and uses the deb package format. This is the most common front-end to the dpkg package manager. For more information visit wiki.debian.org/AptCLI and en.wikipedia.org/wiki/APT_(software).

pacman


Pacman is the official package manager for Arch Linux and uses the pkg.tar.xz tarball package format. This is the only package manager that manages a rolling binary linux distro. For more information visit wiki.archlinux.org/title/Pacman.

nix


Nix is the official package manager and build system for NixOS and uses the nix package format. Nix is a package manager and build system that parses reproducible build instructions specified in the Nix Expression Language, a pure functional language with lazy evaluation. This is a great option for controlled custom environments where you build your own packages and can replicate identical systems easily. For more information visit nixos.wiki/wiki/Nix_package_manager

portage


Portage is the official package manager and build system for Gentoo Linux and uses the ebuild package format. Portage is a package manager and build system based on ports collections. The Package Manager Specification project standardizes and documents the behavior of Portage so that the Gentoo packages (ebuilds) can be managed by other package managers. Portage allows for controlled custom environments where you build your own packages, can replicate identical systems easily, and even be used to create your own operating system, Linux-based or not. Portage is a highly advanced and flexible package manager and build system that Google leverages for building ChromeOS and Chromium Projects www.chromium.org/chromium-os/packages/portage/. For more information visit wiki.gentoo.org/wiki/Project:Portage

pkgtools


Slackware's official package manager is pgktools, which lacks a good primary source, as noted in here cblfs.clfs.org/Pkgtools, with alternative slackpkg, see slackpkg.org, for installing over a network or the internet, and a unofficial spkg, see xff.cz/spkg/, also available. All of the Slackware package managers use the tarball package format.