FUNDAMENTALS A Complete Guide for Beginners
DEB and RPM are the two popular package managers that are mainly used by Debian and RedHat-based Linux distributions respectively. If you understand the differences between the two packages then you will be able to manage the software effectively. I will thoroughly discuss deb vs rpm in this article. You can learn how to distinguish between these two well-known package managers from this writing.
What is DEB?
The Debian package manager packs up all the files into .deb format which are installed, removed, and upgraded with the dpkg and it is a low-level package manager. Debian, Ubuntu, and Linux Mint, the major Linux distributions use Debian package manager.
What is RPM?
RPM is the low-level backward package manager that is mainly used for RedHat-based Linux distributions. It allows users to install, remove, query, and verify packages. RPM package manager wraps up the files into .rpm format which is a binary package format.
Comparative Analysis of DEB vs RPM
Both are package managers for different distribution systems, making it easier to handle packages. To manage the system efficiently one must know about the differences, and similarities between the packages and also should learn the pros and cons of the packages. From the following sections, you can check out the differences, similarities, and pros and cons of these packages.
Deb vs Rpm: Differences
They differ significantly from one another despite having the same properties. Below in the table are some of the variations:
Parameter | deb | rpm |
---|---|---|
Definition | Software package format or extension for Debian-based Linux distribution. | Extension or format for Red Hat-based Linux distribution and rpm package manager. |
Distribution | Debian-based Linux distributions like Ubuntu, Linux Mint, and Parrot OS. | RedHat-based Linux distributions like RHEL, CentOS, and Alma Linux. |
File extension | Uses .deb files. | Uses .rpm files. |
Files | Control files for defining the necessary files to install and perform the proper application. | Spec files for the information of small applications to be installed. |
Tools | apt-get, aptitude, apt | yum,dnf, zypper. |
Repositories | Debian repository which is maintained by the Debian community. | RPM repository is maintained by the RedHat community. |
Manager | Deb files have a low-level package manager called dpkg | Rpm files have a low-level package manager named rpm. |
Compatibility | Limited compatibility. | Limited compatibility. |
Installation | Deb files are installed in the background with the Debian tools. | Rpm files are installed with the Redhat-based tools. |
Dependency Handling | Advanced dependency resolution with front-end tools such as apt, and apt-get. | Effective dependency resolution with front-end tools like yum, and dnf. |
Deb vs Rpm: Similarities
Both deb and rpm are the package managers that are used in Debian and Red Hat-based Linux distributions. Besides many differences, there are some similarities between them:
- System integration: Both package formats are integrated with the system to handle the management of packages such as installation, removal, and upgrade using package manager tools.
- Package signing: Both package formats offer cryptography signature packages in order to guarantee their validity and integrity.
- Meta information: Both of these package formats allow the user to append the information of the package which includes the package name, description, and version.
Deb vs Rpm: Pros & Cons
Here are some of the pros and cons of these two package managers shown in the table:
Package Name | Pros | Cons |
---|---|---|
deb |
|
|
rpm |
|
|
From the above discussion, I hope you get an overview of these packages & that it solely depends on your preferences on which one to use.
Conversion Between RPM and DEB Files
Despite the differences between these two package dependencies and formats, it is still possible to convert between DEB and RPM files. It is not so straightforward method because of its dependencies. But if you really want to convert the files on Ubuntu then just follow these simple steps.
A. How to convert RPM into DEB File
You can convert the deb files into rpm and the rpm files into deb files. For that, firstly you have to install alien. To install alien you can copy this command:
sudo apt install alien
Now, I will convert an rpm file into a deb file. From the image, you can see the marked package which I will convert into a deb file. To do this, you can use the following command:
sudo alien Downloads/zfs-release.el7_7.noarch.rpm
- sudo: Gives administrative privileges.
- alien: A program that converts file formats.
- zfs–el7_7.noarch.rpm: The file I want to convert.
From the above images, you can see, that alien has converted the rpm file into the deb file.
B. How to convert DEB to RPM File
Now, I will convert the deb files into rpm files. Here, I have shown the deb package file that I will convert into an rpm file. You can use the following command on Ubuntu for the conversion:
sudo alien -r Downloads/vlc_3.0.9.2-1_amd64.deb
vlc_3.0.9.2-1_amd64.deb: The file I want to convert.
From the image, you can see that Alien has converted the deb file into an rpm file.
Examples of DEB Package Manager
From the above differences and similarities, you can able to distinguish between these packages. If you want to practice the commands of the Deb package manager on Ubuntu, then check out the following examples of how to install, remove, check, and upgrade a Deb package.
Example 1: How to Install a Package With “dpkg”
To install a dpkg package you have to download the .deb file manually. Here I have already downloaded the .deb file of todesk. You can also download it from here. From the image, you can see that downloaded package. To install the package you can copy the following command:
sudo dpkg -i Downloads/todesk-v4.3.1.0-amd64.deb
- sudo: Permits administrative privileges.
- dpkg: Debian-based low-level command line tool to manage the packages.
- -i: Command option to install the following package.
- todesk: The package which I want to install.
Example 2: Uninstall Package With “dpkg”
Here I will remove a package with dpkg. For removing a package you do not have to use the full name of the file only use the package name. For that, you can copy the following command:
sudo dpkg -r todesk
- -r : Remove the desired package from the repository.
- todesk: The package that I want to remove or uninstall.
Example 3: Check an Installed Package With “dpkg”
For checking an installed package in the deb database, you have to use the deb query which shows you whether the package is installed or not and the version of the package. To do that you can run the command below:
sudo dpkg-query -l | grep todesk
- dpkg-query: A tool to show information about packages listed in the dpkg database.
- -l: List all known packages matching one or more patterns.
- grep: Command-line for searching a file with a particular pattern.
- todesk: The package that I want to check.
Example 4: How to Upgrade a Package With “dpkg”
To upgrade a specific package with dpkg you have to download the upgraded package and then install the file. To install teamviewer you can copy this command:
sudo dpkg -i Downloads/teamviewer_15.43.7_amd64.deb
From the image, you can see the tool installs a new package over the old version of the package. You can not upgrade a package without installing it. With dpkg, you have to install the desired package for the upgrade version.
Examples of RPM Package Manager
Check out the following practical examples of how to install, uninstall, check, and upgrade an rpm package on RedHat.
Example 1: How to Install a Package With “rpm”
The user must manually download the package file first and also can use wget to download the package file. Here I have downloaded the mysql package. You can use any package download link according to your preference or you can copy the following command:
wget http://dev.mysql.com/get/ivh mysql80-community-release-el7-9.noarch.rpm
After downloading the package, you can install that package with the following command:
sudo rpm -ivh mysql80-community-release-el7-9.noarch.rpm
- sudo: Gives administrative privileges.
- rpm: Red-hat package manager to install, uninstall, and manage software packages.
- –i: Command option to specify the rpm command to install the specified app package.
- -v: Option used for the verbose output.
- -h: Show the hash marks that represent the action of the progress.
- mysql: The package name.
Example 2: Check an Installed Package With “rpm”
You’ll need to use the rpm query to determine whether a package is installed or not in the rpm database when checking installed packages. Try the following command to do that:
sudo rpm -q mysql80-community-release-el7-9
- -q: Query command to retrieve information using rpm command.
Example 3: Remove a Package With “rpm”
If you want to remove a package you have to use the -e option which means erase the installed package from the database. You can easily copy the following command to remove mysql:
sudo rpm -e mysql80-community-release-el7-9
- -e: Command option to erase software package.
Example 4: How to Upgrade a Package With “rpm”
I’ll use rpm to upgrade a package here. You can copy this command or use another package based on your requirements:
sudo rpm -U mysql80-community-release-el7-4.noarch.rpm
- -U: Update a desired package.
Conclusion
At the end of this article, you can not clearly understand which one is the best package manager because these two package managers are used for different distribution. So, from the article, you can get to know the key distinctions and similarities between them and able to choose the appropriate one for your distribution. So, it mainly depends on the preference of the user which one is comparatively better.
People Also Ask
Related Articles
- Apt Vs Apt-get What’s the Difference?
- Apt Vs Yum [Difference Between the Package Managers]
- Yum Vs Rpm [Which One is Better]
- Dnf Vs Yum [How Both Are Different]
- Dpkg Vs Apt [What’s the Difference Between Package Managers]
- Apt Vs Rpm [Distinction Between Package Managers]
- Apt Vs Pacman [Which One Should Be Utilized]
<< Go Back to Linux Package Manager Comparison | Package Management in Linux | Learn Linux Basics