How to Install a New Package Manager in Linux

A package manager is essential for managing and maintaining software on your Linux system. Every Linux distribution comes with a package manager by default. Ubuntu comes with the APT package manager, Arch-based distros have Pacman, and so on.


If you want to explore other package managers, here’s how you can install another package manager without having to switch to a brand new distro.


Choose your package manager

There are several package managers that are free to download. Choose your fit and install it. In case you are wondering what the best options are, here is a short list of the most popular package managers for Linux:

1. Pacman

Pacman is the default package manager for all Arch-based distributions. It follows a server-client mechanism to sync updates on the local system with the latest versions on the server, which fits perfectly with Arch’s pioneering philosophy.

2.APT

Advanced Package Tool or APT is a free, open-source package manager that ships as the default package management solution for Ubuntu/Debian derivatives. It’s user-friendly, fast and reliable.

3. DNF

Dandified Yum or DNF is the generational successor to the Yellowdog Updater Modified (YUM) package manager. DNF is most commonly used as the primary package manager on RPM-based Linux distributions – Fedora, CentOS, and RHEL.

Developed with the main motive of smoothing out the loopholes in YUM, DNF offers performance boosts and other quality of life improvements for those migrating from YUM.

Installing a new package manager on Linux

The installation steps differ from one distribution to another, depending on which package manager you install and where you install it. Let’s look at installing different package managers in three of the most commonly used Linux distributions – Ubuntu, Arch and Fedora.

While you are free to install and try different package managers on the same distribution, there can often be conflicts between package managers and, worse, dependency problems.

These issues can cause hiccups in your Linux desktop experience, so we recommend choosing a distro based on the package manager it comes with.

How to install Pacman on Ubuntu/Debian

There is no official Ubuntu/Debian compatible Pacman variant. So you’ll have to settle for a Pacman emulating script that accepts Pacman commands to invoke the appropriate options in APT. Here’s how to emulate Pacman in your Ubuntu/Debian-based distribution:

  1. As a first step update and upgrade your system with:
    sudo apt-get update && sudo apt-get upgrade
  2. Download the DEB package of the latest build of the Pacman package manager from the official Deb-Pacman repository using the wget command. If you are using an RPM-based distribution, download the RPM package for installation. You can also download the package manually if you don’t want to use wget.
  3. Install the package with dpkg by running:
    sudo dpkg -i deb-pacman-*.dpkg

Call the Pacman emulator script with the Pacman command and use it like you would use Pacman on any Arch Linux based distribution. Try a few Pacman commands to get a feel for it and look for errors. For a true Pacman experience, we recommend you switch to Arch Linux.

How to install DNF on Ubuntu and Debian

Unlike Pacman, you can install the DNF package manager directly with APT, saving you the hassle of manually arranging build files. Follow these steps to install DNF on your Debian-based Linux distribution:

  1. As a first step update and upgrade your system with:
    sudo apt update && sudo apt upgrade
  2. Issue the following command to install DNF using the APT package manager:
    sudo apt install dnf

APT will now start installing the DNF package manager on your system. Test it out by trying a few basic commands. First, try downloading and installing a new package as you would with regular RPM-based distributions.

How to install APT on Fedora and other RPM based distributions

Similar to installing DNF on Ubuntu using APT, you can install APT on Fedora using the DNF package manager. Follow these steps to install APT on your RPM-based Linux distribution:

  1. As a first step update and update your system with:
    sudo dnf upgrade
  2. Issue the following command to install APT using the DNF package manager:
    sudo dnf install apt

You should now have the APT package manager installed on your system. Invoke it by typing it suitable and try out a few basic commands to get started.

How to install Pacman on Fedora and other RPM-based distributions

You can install Pacman on Fedora and other RPM-based distributions by downloading and installing the package using the DNF package manager. Here are the steps you need to follow:

  1. As a first step update and update your system with:
    sudo dnf upgrade
  2. Issue the following command to install Pacman using the DNF package manager:
    sudo dnf install pacman

DNF would now begin installing Pacman on your system. Enter to learn how to use it sudo pacman -h and you will get a complete list of all commands and functions that Pacman offers.

How to Install APT and DNF on Arch Linux

You can install APT and DNF package managers on Arch Linux from the Arch User Repository (AUR). AUR is a community-driven repository hosting thousands of packages contributed by Arch users. You can either use an AUR helper like yay or manually install the packages in your system.

To install APT and DNF on Arch Linux:

  1. As a first step update and upgrade your system with:
    sudo pacman -Syu
  2. Issue the following command to install DNF and APT with yay:
    yay -S dnf && yay -S apt

The package managers APT and DNF should be installed on your system. You can now use them for all your package management tasks.

Efficiently manage packages on your Linux system

If you’re motivated to use Linux as your daily driver, you should invest the time and effort in learning the basics of package management to ensure your system stays efficient and fast.

Package management is key to the longevity of your Linux system and ensures that your system is not compromised by corrupted packages.

Leave a Reply

Your email address will not be published. Required fields are marked *