An RPM package is a software distribution format that is handled by RPM(RedHat Package Manager) primarily in RedHat-based Linux distributions. Various Linux distributions beyond RHEL (RedHat Enterprise Linux) such as CentOS, Fedora, and others use it. However, installing rpm or any other package in your system may prerequisite some other packages called dependencies. This tutorial will guide you to successfully install an RPM package with all its dependencies.
Key Takeaways
- Installing RPM package in Ubuntu, RHEL, and Fedora.
- Inspecting dependency issues regarding Photocollage installation.
- Resolving dependency automatically using apt and yum.
Requirements
- System running on Ubuntu/RHEL/Fedora.
- Sudo privileges to use the core functionality of package managers.
- Installed Alien tool if you are using Ubuntu.
Process Flow Chart
[Distros Used Throughout the Tutorial: Ubuntu 22.04.1 LTS and RHEL 9.2]
Free Downloads
Process to Install RPM With Dependencies in Various Distributions of Linux
Dependencies specify what other packages need to be installed on the system for a particular package to work as intended. “.rpm” is a package extension used to install software on Linux distributions that follow the RedHat ecosystem. I’ll show you one way for RedHat-based distribution and two ways for Debian-based distributions that you can use to install any .rpm package in your running system.
A. Install RPM With Dependencies in RedHat-Based Distros Using YUM
Actually, rpm packages are built to run in RedHat-based Linux distributions such as CentOS, Fedora, and RHEL. These distributions have two widely used package managers called “yum” and “rpm”. YUM (Yellowdog Updater, Modified) is a command-line package management tool used primarily in Red Hat-based Linux distributions. It is a high-level package management tool that provides an efficient way to install and update software, and automatically handle dependencies on these distributions. I’ll show the installation of gnome-photos using yum which is a photo-sharing application for Linux.
Steps to Follow >
➊ Open the RHEL/Fedora terminal.
➋ Run the below command:
sudo yum install gnome-photos
➌ Enter the user password.
➍ Type Y when the confirmation prompt appears.
➎ Press ENTER. The above command will show a list of dependencies and yum will automatically install all those dependencies. In case you want to install a locally downloaded .rpm file using yum, run the below command:
sudo yum install <filename.rpm>
B. Install RPM With Dependencies in Debian-Based Distros
Although rpm is a package type built for RedHat-based distribution, you can install an rpm package in the Debian-based system by converting the file type from rpm to deb. To illustrate, I’ll install the rpm file of Photocollage in Ubuntu by two methods. In the first method, I’ll show the installation of the rpm file of Photocollage by alien tool. Secondly, I’ll use alien to convert the rpm file to deb package and then install the deb with dpkg.
Method 01: Using Alien to Directly Install RPM Package in Ubuntu
“alien” is a command-line tool used to convert and install packages between different package formats on Debian-based Linux distributions. You can use it to convert rpm packages into Debian packages (.deb files) or vice versa. Follow these steps to install a Photocollage.
Steps to Follow >
➊ Download the RPM file from a trusted source. You can download and extract the Photocollage-1.4.5 rpm file from the Free Downloads section in this article.
➋ Open the Ubuntu terminal.
➌ Run the below command to verify the download:
ls Downloads/
➍ Go to Downloads/ directory:
cd Downloads/
➎ Use the following command to convert the rpm file into a deb file.
sudo alien -i photocollage-1.4.5-2.fc39.norarch.rpm
➏ Type the user password.
➐ Press ENTER. Now, alien will install the rpm file in Ubuntu.
Method 02: Using DPKG to Install RPM Package in Ubuntu
DPKG (Debian Package Manager) is a low-level package manager used in Debian-based Linux distributions such as Ubuntu. dpkg is the package management tool provided by DPKG that can install any .deb file without resolving dependencies. So, a rpm file can’t be directly installed by dpkg. But you can convert the rpm file to a deb package using alien.
Step 01: Converting “.rpm” to “.deb” File in Ubuntu
After downloading the RPM file, just follow the steps to convert the .rpm file to .deb file:
Steps to Follow >
➊ Open the Ubuntu terminal.
➋ Run the following command from the home directory:
cd Downloads/
sudo alien -d photocollage-1.4.5-2.fc39.norarch.rpm
The above command will convert the photocollage-1.4.5-2.fc39.norarch.rpm file into photocollage-1.4.5-2.fc39.norarch.deb file. You can find it in the same Downloads/ directory.
Step 02: Install the Converted “.deb” File in Ubuntu
After converting the rpm into deb, you can use dpkg to install the deb file. Go back to your terminal and follow the steps:
Steps to Follow >
➌ Run the following command:
sudo dpkg -i photocollage-1.4.5-2.fc39.norarch.deb
Comparative Analysis of Methods
I’ve shown two ways to install an rpm package with dependencies in Ubuntu. You might be confused to decide which one suits you the best. Here’s a comparison between the methods provided to give you an overview of the pros and cons. Method 1: Using alien Method 2: Using dpkg
Methods
Pros
Cons
Common Challenge: Dependency Error in Ubuntu
In Method 2, I’ve shown a way to install the converted deb file by dpkg. To illustrate the process by example I’ve installed Photocollage which showed no dependency error but, other packages may show. For example, dependency errors like the below image may occur if you use the TeamViewer package instead of Photocollage. To resolve this kind of dependency error, follow these steps:
Steps to Follow >
➊ Open the Ubuntu terminal.
➋ Run the following command:
sudo apt install -f
➌ Type Y when the confirmation prompt appears.
➍ Press ENTER. After fixing the dependency error by the above command, you can run the “sudo dpkg -i <filename.deb>” command to install the package, and this time no dependency error will occur.
Install the Alien Tool in Ubuntu
“Alien” is a command-line tool that helps in converting and installing packages between different package formats. It primarily deals with converting packages from the .deb format used by Debian-based systems like Ubuntu to other formats such as .rpm used by Red Hat-based systems and vice versa. To install alien, follow these steps:
Follow the Steps >
➊ Open the Ubuntu terminal.
➋ Run the following command:
sudo apt-get update
It will update the apt-get tool.
➌ Run the following command to add the “universe” component to all repositories:
sudo add-apt-repository universe
➍ Type the user password.
➎ Press ENTER.
➏ Run the below command to install alien:
sudo apt install alien -y
Thus, you can install alien on your system.
Conclusion
RPM is a package type generally used in RedHat-based Linux distributions. RedHat provides yum which is a high-level package management tool that can handle dependencies automatically when installing any rpm package. Moreover, you can install an rpm package in your Debian-based system also by converting it into a deb package by alien. However, it’s generally recommended to use packages that are specifically built for your distribution to ensure system stability and proper functionality.
People Also Ask
Related Articles
- How To Check Package Dependencies in Linux [3 Easy Ways]
- How to Install Dependencies Using dpkg? [Easiest Solution]
- How to Install Missing Dependencies in Ubuntu? [4 Methods]
- Install Dependencies Automatically in Ubuntu [3 Exclusive Methods]
- 5 Methods to Remove Package and Dependencies in Ubuntu
- 2 Ways to Install RPM Without Dependencies in Linux
- How to Check RPM Reverse Dependencies in Linux? [4 Methods]
- [Solved] RPM Failed Dependencies Error in RedHat
- 2 Methods to Install YUM Packages with Dependencies
- Remove Packages without Dependencies Using Yum [2 Methods]
- [Solved] The Following Packages Have Unmet Dependencies Error
- How to Check APT Dependency Tree in Linux? [4 Methods]
<< Go Back to Dependencies in Linux | Package Management in Linux | Learn Linux Basics
FUNDAMENTALS A Complete Guide for Beginners