2 Ways To Install RPM packages on Ubuntu

Software packages for Linux generally come in two main formats: Debian packages (.deb) for systems like Ubuntu and RPM packages for Red Hat-based systems. You might encounter a situation where a specific driver or proprietary tool is only distributed as an RPM file, leaving you unable to use the standard apt install command. Without a way to bridge this gap, you cannot access critical software required for your project.

Ubuntu does not support RPM files natively, as its core package management system is built around the Advanced Package Tool (APT) and dpkg. This guide explains two effective methods to handle RPM files on Ubuntu: converting them into the native Debian format using the Alien tool or installing a standalone RPM manager. Mastering these approaches allows you to expand your software library while maintaining system stability.

Key Takeaways: Managing RPM on Ubuntu

  • Alien Tool → The most reliable way to handle RPMs by converting them into .deb files before installation.
  • Package Compatibility → RPM files are designed for different library versions; always check file size in Linux and dependencies before proceeding.
  • Sudo Privileges → You must understand the Linux sudo command to install the necessary conversion utilities.
  • Dependency Management → Unlike native packages, converted RPMs may require you to manually resolve missing shared libraries.

Method 1: Using the Alien Tool (Recommended)

Alien is a program that converts between different Linux package formats. It is the safest way to install an RPM on Ubuntu because it creates a standard Debian package that the system can track.

1. Install Alien: First, update your repositories and install the utility: sudo apt update && sudo apt install alien -y

2. Convert and Install: You can convert and install the package in one step using the -i flag: sudo alien -i your-package.rpm

Expected Output:

your-package.deb generated
Checking for conflicts...
Installing your-package.deb...
Selecting previously unselected package your-package.

Method 2: Installing the RPM Package Manager Directly

If you prefer to manage RPMs using native Red Hat commands, you can install the rpm utility itself on Ubuntu. However, this method will not automatically resolve dependencies.

1. Install the RPM utility: sudo apt install rpm

2. Install the file: sudo rpm -i --force-debian your-package.rpm

Warning: This method bypasses the Ubuntu package database, which can lead to system conflicts if the package tries to overwrite essential Ubuntu files.

See also: Mastering the Linux Command Line — Your Complete Free Training Guide


Step-by-Step Process: Converting RPM to DEB

Follow these steps to safely convert an RPM file into a Debian package for permanent use on your system:

  1. Open your terminal and navigate to the directory containing the RPM file.
  2. Verify the package name and version to ensure it matches your hardware architecture (e.g., x86_64).
  3. Run the conversion command: sudo alien your-package.rpm.
  4. Confirm the .deb creation: Look for the newly generated .deb file in your current folder.
  5. Install the converted file: Use sudo dpkg -i your-package.deb.
  6. Fix missing dependencies: If the installation errors out, run sudo apt install -f to fetch required libraries.

Summary Tables

MethodTool UsedBest Use CaseRisk Level
ConversionAlienGeneral software and driversLow
Direct InstallRPM CommandSpecialized legacy toolsHigh
Manual ExtractcpioInspecting file contentsNone
Alien FlagPurpose
-dGenerate a Debian (.deb) package (default).
-iAutomatically install the package after conversion.
-rConvert a Debian package back to RPM.
-kKeep the version number from the original RPM.

FAQs

Will every RPM work on Ubuntu after conversion? No. While the format changes, the software inside still expects specific system libraries. If the RPM was built for a very old version of CentOS, it might not run on a modern Ubuntu LTS.

How do I uninstall an RPM I installed with Alien? Because Alien creates a .deb file, you can remove it like any other Ubuntu package: sudo apt remove package-name.

Why should I use sudo for these commands? Installing software modifies system-level directories like /usr/bin and /etc. These areas are protected to ensure Linux server security.


Related Posts

David Cao
David Cao

David is a Cloud & DevOps Enthusiast. He has years of experience as a Linux engineer. He had working experience in AMD, EMC. He likes Linux, Python, bash, and more. He is a technical blogger and a Software Engineer. He enjoys sharing his learning and contributing to open-source.

Articles: 643

Leave a Reply

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