How To Install Rpm File In Ubuntu

How To Install Rpm File In Ubuntu

Reading time1 min
#Linux#Ubuntu#Software#RPM#PackageManagement

Mastering RPM Installation on Ubuntu: A Practical Guide to Bridging Package Formats

Think you need to switch to Fedora or CentOS to run RPM packages? Think again. Unlock the power of RPMs on your Ubuntu system with straightforward, reliable steps that expand your Linux toolkit without the overhead of dual-booting or containers.


Ubuntu is renowned for its solid package management system centered around DEB packages and the apt toolchain. But what happens when you want to install software distributed as an RPM (Red Hat Package Manager) file—commonly used in Fedora, CentOS, and RHEL ecosystems—without switching distros or resorting to complex container setups?

This practical guide will walk you through the most effective ways to install RPM packages on your Ubuntu machine, empowering you to harness a wider range of software seamlessly.


Why You Might Need to Install RPMs on Ubuntu

  • Enterprise Software Distribution: Many enterprise-grade applications release only RPM files.
  • Third-Party Tools: Certain proprietary drivers or utilities still distribute RPMs.
  • No DEB Equivalent: Sometimes the software vendor doesn't provide a DEB package or PPA.
  • Experimentation: You want to test software without jumping through hoops or switching distros.

Understanding the Challenge

RPM and DEB packages use different formats and metadata. Ubuntu’s native tools (dpkg, apt) can’t directly handle RPM files without conversion or additional tools. Trying to force-install an RPM will almost certainly trigger dependency issues or fail outright.

But don’t worry — the Linux community has developed several reliable methods for bridging this gap.


Method 1: Using alien — Convert RPM Packages into DEBs

The most straightforward approach is using the alien utility, which converts between different Linux package formats (RPM → DEB, among others).

Step 1: Install Alien

sudo apt update
sudo apt install alien

Step 2: Convert the RPM Package

Assuming you have an example RPM file called example-software.rpm:

sudo alien example-software.rpm

This generates example-software.deb.

Step 3: Install the Converted DEB

sudo dpkg -i example-software.deb

Example Walkthrough

Let’s say we want to install a third-party tool packaged as toolkit-1.2.3.rpm.

wget http://example.com/downloads/toolkit-1.2.3.rpm
sudo alien toolkit-1.2.3.rpm
sudo dpkg -i toolkit_1.2.3-2_amd64.deb    # The deb name might vary slightly.

Caveats When Using Alien

  • The conversion is generally reliable but not perfect.
  • Some complex RPMs with scripts/hooks might behave unexpectedly.
  • Dependency issues can arise; be prepared to manually resolve dependencies via apt.
  • Always check if a native DEB or Snap package exists first.

Method 2: Using Containerized Environments (Alternative)

If you prefer not contaminating your main system with foreign packages, consider running applications inside containers based on Fedora/CentOS images where RPM is native.

Example tools:

  • Docker
  • Podman

This method is ideal for ephemeral or isolated usage but involves learning container basics and managing images.


Method 3: Installing Required Tools From Source (Advanced)

Less common but possible is building and installing tools from source that depend on specific RPM packages—for instance, downloading binaries contained within an RPM manually by unpacking it (rpm2cpio can convert an rpm into a cpio archive).

sudo apt install rpm2cpio cpio
rpm2cpio example-software.rpm | cpio -idmv

You can then manually place binaries wherever suitable or run directly from extracted files.


Tips for Managing Dependencies and Conflicts

Because Ubuntu uses different libraries and sometimes different versions than CentOS/Fedora, converted RPMs may fail due to unfulfilled dependencies.

A few ways to mitigate:

  • Check dependencies before installation (rpm -qpR package.rpm on a system that has rpm installed).
  • Search Ubuntu repositories for equivalent packages.
  • Use PPAs or snaps where possible as they handle dependencies gracefully.
  • Consider isolating tricky apps using lightweight VMs or containers.

Summary: Steps To Bridge The Gap Efficiently on Ubuntu

StepActionCommand Sample
1Install aliensudo apt install alien
2Convert .rpm.debsudo alien package-name.rpm
3Install converted .debsudo dpkg -i package-name.deb
4Fix broken dependenciessudo apt-get install -f

Final Thoughts

Installing RPMs on Ubuntu doesn't require switching distros or complicated workarounds anymore. With tools like alien, some savvy dependency management, and cautious testing, you can comfortably master this bridging technique in your Linux workflow.

Next time you come across software packaged in .rpm, don’t hesitate — open up your terminal and bridge those package worlds like a pro!


Got questions or tips about installing tricky RPMs on Ubuntu? Drop them in the comments below!