mag72

Best Linux Package Managers

Best Linux Package Managers

Diego Asturias

The operation and architecture of the different Linux Package managers will vary from distribution to distribution. But generally, all Linux package managers should help install, remove, update, audit, and solve challenging dependency and software version issues.

In this post, we’ll review the best and most popular Linux Package Managers. These include yum, DNF, apt, Pacman, zypper, Portage, and a few other honorable mentions.

Here is our list of the best Linux Package Managers:

  1. YUM An old-time RPM font-end favorite, known and understood by many but slowly being replaced by DNF.
  2. APT A popular DPKG front-end with a complete dependency resolution and package management.
  3. Pacman A popular Arch-Linux package manager that allows using a pre-built package or build-it-yourself.
  4. Zypp/Zypper A popular front-end to RPM used in OpenSUSE and SUSE Linux Enterprise. Zypper is knowns for its SAT solver, a fantastic dependency issue solution.
  5. DNF The popular replacement for yum. It is now the default package manager in Fedora 22 and Red Hat Linux 8.
  6. Gentoo’s Portage Portage provides a fantastic way to manage packages to one of the most flexible yet challenging Linux distributions.
  7. Honorable Mentions We add three honorable mentions to our best Linux Package manager list: eoPKG, NIX, and Snap.

A package and its manager

Packages were created to simplify software distribution and installation. In addition, they solve the challenging and tedious work of having to compile software and handle all its dependencies.

A package is a compressed file archive or collection of files to perform a specific task or application. It contains:

  • Precompiled software Binary executable files to allow end-users easy software installation.
  • Metadata A small file is providing the version number and description (metadata) of the program.
  • A list of dependencies The information on the required programs and versions. Dependencies are needed for the packaged software to work correctly.

Linux-based computers depend on packages that can be managed via software repositories. Packages control the inclusion, maintenance, and removal of programs on a computer.

Common examples of different Linux-based package formats are RPM and DEB. These are both archive files with metadata attached to them. For example, RPM is used for Red Hat distributions and DEB for Debian-based distributions.

When Linux packages start piling up, their dependencies and versions of dependencies become more complex and often unmanageable; you’ll need to use a package manager.

a. The package manager

A package manager, also known as a package management system, allows you to install, configure, audit, upgrade, or remove software packages from your Linux operating system. 

On a basic level, package managers follow a similar process, which starts by:

  • Launching software that reads from a repository
  • Determining the software to install, remove, or update

Package managers should automatically identify the “lacking” dependencies and download all the necessary packages from a single repository. Although all Linux package managers perform the same fundamental function, which is to maintain the software on a Linux-based machine, they vary according to their architecture, interface, syntax, and format.

b. Pre-built vs. build-it-yourself

Generally, there are three different ways to install software using a package manager. The most popular way is using the pre-compiled (pre-built) software package. Second, you can also use a script that lets you compile, build, or re-compile software. And finally, you can use a combination of both.

  • Most Linux distributions, including Debian, Ubuntu, Red Hat, and Fedora, use Deb and RPM format packages with pre-compiled binaries.
  • Other distributions like Gentoo Linux uses a package management system based on the distribution’s source. This package manager employs the concept of “use flags” to let you choose which software to compile.
  • Arch Linux uses a package manager that combines the two approaches. In addition, it provides more flexibility by allowing you to use default precompiled packages (as deb and rpm) and create, compile, or re-compile packages.

c. Differentiating Features

As mentioned earlier, the essential feature of a package manager is to find, install, maintain and uninstall packages. But package managers do differentiate themselves with a couple of parameters, including: 

  • Package Manager Formats
    The most apparent distinction between package managers is their format. Different package managers were built for specific package formats. For example, package managers like YUM, DNF, and Zypper are based on RPM (Red Hat-based), while package managers like APT, APT-Get are built for DEB packages.
  • Dependency issues and conflict resolution
    Dependency hell is a popular term used by people with complex dependency scenarios. Dependency conflicts occur when a software package has dependencies on other software versions of other packages or libraries. Still, these dependencies depend on different (and often incompatible) versions of the shared software packages. Some Linux package managers help solve these dependency issues and handle conflict resolution, while others simply won’t.
  • Simple package audit
    Some package managers provide the what, who, when, and where to package management. There are different ways to review what packages were installed or removed, when, by who, etc. Some package managers are better for this than others.

The Best Package Managers

The following are considered the most popular and best Linux package managers. Some of these are considered the best due to their large community, and others provide outstanding flexibility.

1. Yellow Dog Updater, Modified (YUM)

Yellow Dog Updater, Modified (YUM)

The Yellowdog Updater, Modified (yum), is a command-line package-management utility and front-end for the Red Hat Package Manager (RPM). Although RPM was created to manage packages in Red Hat Linux, it is now used in many Linux distributions including, CentOS, OpenSUSE, Fedora, and more.

Highlights

  • Automatic updates
  • Package and dependency management
  • Dependency resolution when installing/removing, or updating packages
  • Superb usability, syntax, and informational output

YUM is based and depends on the RPM; thus, it can manage .rpm packages (RPM distributions) from local or Internet-based repositories. Yum is often used in Fedora, CentOS (5 and above), and Red Hat Enterprise (5 and above). Although YUM uses a CLI, many other tools, like YUM Extender (yumex), provide the GUI to YUM’s functionality.

Example of useful yum’s commands [Refer to yum’s cheat sheet]:

Description Command
Install a packageyum install pkg
Remove a packageyum erase pkg
List all yum actionsyum history list

Verdict: Although yum is still the preferred package manager for rpm-based Linux distributions, some long-standing issues haven’t been fixed. These issues include slow dependency resolutions, excessive memory usage, and undocumented API. So now yum is slowly being replaced by DNF.

2. APT

APT

The Advanced Package Tool (or APT) is the popular command-line manager that handles the installation and removal of software packages for Debian, Ubuntu, and other related Linux distributions.

Features

  • Available commands for searching, managing, and querying information about packages
  • Provides low-level access to “libapt-pkg” and “libapt-inst” libraries
  • A high-level interface tool for package management
  • APT performs a topological sorting. First, it creates a packages list of to-be-installed and removed

APT is the front-end of the Debian Package (DPKG), which is the base package manager for Debian distributions. APT uses DPKG on the back-end to install and remove packages. Aside from managing packages and their dependencies relationships, it also allows sourcing and higher-level versioning management. APT can also get packages from remote locations and deal with more complex dependencies resolutions.

APT vs. APT-get? The apt-get is also another feature-rich CLI front-end version of the DPKG system. APT is the subset of the older command-line tools, apt-get, and apt-cache. It uses the same prefix and is user-friendlier than both tools.

Example of useful APT’s commands:

Description Command
Update package databaseapt update
Install a packageapt install
Remove a packagesudo apt remove

Verdict: APT is the preferred package manager for any Debian-based distribution. But using it can get complex once more PPA keys and extra repositories are added.

3. Pacman

Pacman

There are two main reasons why few people would prefer to use Arch Linux: one is because it provides full customization, and two because it comes with an outstanding package manager, known as Pacman.

Features

  • Dependency support
  • Build packages from official repositories
  • Manage your builds. Install or uninstall scripts
  • Sync a local machine with a remote repository
  • Pacman 6.0 includes new features like parallel download support, retry downloads, events for download completion, and more

As mentioned earlier, Arch Linux uses the one-of-a-kind package manager, “pacman,” which allows you to either use a pre-built package (from repositories) or build it yourself from scratch. Pacman includes a set of commands to manage all the Arch-based packages and comes with binary packages to help with a package build. This advanced package manager uses simple compressed files “bsdtar(1) .tar” as a package format and a package database system.

Example of useful Pacman’s commands:

Description Command
Install and update package listpacman -Syu
Uninstall packagepacman -Rsc
Search keywordpacman -Ss

Verdict: Arch Linux distribution focuses on simplicity and versatility. These are why Pacman provides a faster and more straightforward approach to package manager than Debian-based cousin APT-get. The only downside is that Arch Linux requires more time for fine-tuning and knowledge.

4. Zypper

Zypper

Zypp is the main package kit for OpenSUSE and SUSE Linux Enterprise. It is also the package management system that powers the package managers, Zypper and YaST.

Features

  • Zypper is part of mobile Linux distributions Tizen, Sailfish OS, and MeeGo
  • The SAT solver provides the fastest dependency resolution
  • Zypper allows you to configure, add or remove repositories
  • Highly flexible syntax format. You can use commands in full or short format
  • Zypper supports RPM Metadata and YaST2 package repositories

Zypper is the robust command-line (front-end to RPM) package manager for installing, removing, and updating packages, in addition to managing and accessing repositories. It is an open-source project available since openSUSE ver 10.2, Fedora (since Fedora 26), and Tizen.

What makes Zypper stand apart from other package managers is its powerful dependency solution known as SAT solver. When there is a dependency problem, Zypper provides multiple solutions and presents the output using an informative and clean tabular format.

Example of useful Zypp’s commands [Refer to Zypper’s Cheat Sheet]:

Description Command
Install packagezypper install or zypper in
Update a packagezypper update or zypper up
List repositoryzypper repos or zypper lr

Verdict: Zypper is one of the youngest projects. Although the project is in constant development and improvement, its community is still relatively small.

5. DNF

DNF

Dandified YUM or DNF is another RPM front-end, designed to replace yum as the default package manager in Fedora 22 and Red Hat Linux 8. It is also used in CentOS, Mageia, OpenMandriva, and Yocto.

Features

  • DNF maintains almost full CLI compatibility with yum
  • DNF uses external dependency resolver libraries, Libsolv and Hawkey
  • Improved memory-intensive operations
  • Full API documentation is available
  • Runs in Python 2 and Python 3

DNF improves YUM in multiple ways, including performance, conflict dependency resolutions, and easier integrations. In addition, the package manager provides an architecture for extending package management functionality via plugins. There are more than 25 plugins officially already supported by DNF and more on development by DNF’s community.

Example of useful DNF’s commands:

Description Command
Install packagednf install
Remove a packagednf remove
List all repositoriesdnf repolist all

Verdict: DNF was designed to address the deficiencies of yum, and will soon replace it. The landscape for DNF has changed since Fedora, and Red Hat Linux adopted it as its default package manager. Although its community is smaller than yum, its adoption is quickly increasing.

6. Gentoo’s Portage

Gentoo’s Portage

Gentoo is known to be the most challenging and distinctive Linux distribution out there. It is believed to be the same as Linux From Scratch (LFS), but with the exception that it comes with an exceptional package manager known as Portage.

Features

  • Portage runs on ebuilds. These are text files that identify a specific package and determine how Gentoo should deal with it
  • It uses CFLAGS, which are environment variables used to specify compilation options
  • It gives you the flexibility to change the dependencies for every installed package and choose software versions and upgrade timings
  • An out-of-the-box, fully functional development environment

Portage is Gentoo’s official package manager and software distribution system. It provides outstanding flexibility, which makes it an OS-independent package manager. Although Portage is built for Gentoo, it is also used by Chrome OS, Calculate, and others.

Portage allows package, dependencies, and repository management. It lets administrators fine-tune packages to suit their specific needs, manage config files and multiple slots for different versions of the same software.

Example of useful Gentoo’s commands:

Description Command
Update softwareemerge --sync
Install a packageemerge package
Update all packages in the systememerge -uD @world

Verdict: Portage is considered one of the most advanced package management systems. But starting with Gentoo Linux can be challenging. Gentoo doesn’t come with pre-compiled software and management tools, so you must configure everything from scratch.

7. Honorable Mentions

Below are three honorable mentions for Linux Package Managers. 

  • eoPKG
    Solus, an Arch-based Linux distribution, uses a package management system know as eoPKG (evolve OS package). eoPKG is based on PiSi (Packages Installed Successfully as Intended), the package manager from Pardus Linux.
  • NIX
    A cross-platform package manager with a unique approach to package management and system configuration. The NIX package manager is the foundation of the NixOS Linux distribution.
  • Snap or Snappy
    Canonical, the company responsible for Ubuntu, develops Snap, an alternative way to manage packages. Snap can be used in Ubuntu, as well as other Linux distributions. Snap uses Snaps, the containerized software packages that are easy to build and deploy.

Final Words

A package manager would not make you change to an entirely new distribution, but it does make a big difference. After all, package managers simplify installing, updating software on Linux, and even dealing with the dependency hell.

We went through the best and most popular Linux Package managers in this post, including YUM, APT, Pacman, Zypp/Zypper, DNF, and Gentoo’s Portage.

Which one is your favorite package manager?

Please leave your comments below.