How to Install a New Package Manager in Linux
Last Updated :
08 Dec, 2023
Linux offers several package managers for software installation, updates, and maintenance. In Linux, every distribution comes with a package manager by default. The Debian distribution comes with APT(Advanced Package Tool), Red Hat, and its derivatives such as CentOS and Fedora use YUM package management.
However, there may be cases when you need to use different package managers. In this article, we'll cover the installation and setup of three prominent package managers which are:
- DPKG: DPKG is a base package management system used in the Debian Linux family, it is used to install, remove, store, and provide information about '.deb' packages. 'dpkg' is a low-level package manager and is used in combination with higher level package managers like 'apt' or 'apt-get', which provide more user-friendly interfaces for package management.
- APT: APT is a powerful tool used in Debian-based distributions such as Ubuntu, Linux Mint, and many others. APT makes the process of installing, updating, and removing software packages simple. APT manages dependencies by itself and ensures all the packages are installed when you install a new package.
- DNF: DNF stands for 'Dandified YUM' and is the default package manager of Red Hat-based Linux distributions. It is the evolution of the YUM(Yellowdog Updater, Modified) package manager which improves performance, dependency resolution, and usability.
Installation of a New Package Manager on Linux
Installation of different packages differs in steps at different linux distributions. Let's look at the installation of three different package managers one by one:
Installing DPKG in Debian
Package managers are core components of linux systems, and are pre-installed. To check the version of 'dpkg' or if it is preinstalled go to Step 4 directly. However, if you need to reinstall follow the steps given below:
Step 1: Open the terminal using the keys CTRL+ALT+T or by searching the terminal in the start menu.
TerminalStep 2: To install 'dpkg' in Debian, we are using 'apt-get' which is another package manager. In the first step, we will update the apt-get to ensure that our local package database gets synchronized with the latest updates.
sudo apt-get update
After entering the above command you need to enter the administrator password to provide root user privileges.
'sudo'Debian: This command allows users with permission to execute commands with superuser(root) privileges.
'apt-get': It is a command line package management tool in Debian-based systems. It is used for installing, removing, or updating various packages.
apt-get update
Step 3: To reinstall the 'dpkg' package in Debian, we need to enter the following command in the terminal:
sudo apt --reinstall install dpkg
The above command tells 'apt-get' to reinstall the 'dpkg' package.
Reinstallation of dpkg
Step 3: To check if the package is installed, and the version of the package. Enter the following command:
dpkg --version
Version Info of dpkg packageInstalling APT in Ubuntu
APT is installed in Ubuntu as the default package manager. To check the version of 'apt' or if it is preinstalled go to Step 4 directly. However, if you need to reinstall the package use the following steps :
Step 1: Open the terminal using the keys CTRL+ALT+T or by searching the terminal in the start menu.
Terminal
Step 2: To install 'apt' in Ubuntu. Enter the following command in the terminal to download the 'apt' package:
sudo apt-get update
sudo apt-get updateStep 3: Install the downloaded 'apt' package using 'dpkg':
sudo apt-get -y install apt-file
Install the downloaded 'apt' package
Step 4: To verify if it is installed and the version of 'apt'. Enter the following command:
apt --version
apt Version
Installing DNF in RHEL(Red Hat Enterprise Linux):
DNF is installed in RHEL distributions as the default package manager. To check the version of 'dnf' or if it is preinstalled go to Step 3 directly. However, if you need to reinstall the package use the following steps :
Step 1: Open the terminal using the keys CTRL+ALT+T or by searching the terminal in the start menu.
Step 2: We can use the 'yum' package manager to install 'dnf':
sudo yum install dnf
You need to enter your password to grant sudo permission.
Step 3: To verify if it is installed and the version of 'dnf'. Enter the following command:
dnf --version
Conclusion
In this article, we discussed the installation of package managers in different linux distributions. We learned about the installation of the three most prominent packages for the most widely used linux distributions. Hope this article resolves your problems. To find solutions for more linux problems, refer to More Geeks for Geeks articles that are published on a variety of topics. Happy learning!
Similar Reads
How to Manage Debian Packages in Linux? Debian, one of the oldest and most respected Linux distributions, is renowned for its stability, security, and robust package management system. Managing Debian packages effectively is crucial for maintaining a healthy and well-functioning Linux system. In this comprehensive guide, we will explore e
9 min read
How to Install Package Manager in Windows 11? Installing a package manager on Windows 11 is a convenient way to streamline your software management. One of the most popular tools for this purpose is Winget, the built-in Windows 11 package manager. With Winget, you can easily download, install, and update software via the command line, making it
5 min read
How to Install Packages in Python on Linux? To install a package in python, we use pip. The pip is a python package manager. In this tutorial, we will be discussing how we can install packages in python on a Linux system. To install packages in python on Linux, we must have python and pip installed on our Linux machine. As python comes preins
2 min read
How to Install RPM Packages on Linux? Red Hat Package Manager or RPM is a free and open-source package management system for Linux. The RPM files use the .rpm file format. Â RPM package manager was created to use with Red Hat Linux, but now it is supported by multiple Linux distributions such as Fedora, OpenSUSE, Ubuntu, etc.RPM packages
3 min read
How to List Installed Packages on Linux Managing installed packages is a core aspect of maintaining a clean and efficient Linux system. Whether you're troubleshooting software conflicts, planning system updates, or freeing up disk space, knowing how to list installed packages is essential or finding installed software in Linux. In this ar
8 min read