Website Vidya
Linux & ServersStep-by-Step Guide

How to Install RPM Packages on Ubuntu: Alien and rpm2cpio Guide

Learn how to install rpm packages on ubuntu using Alien to convert RPM to DEB, extract files with rpm2cpio, handle dependencies, and clean removal.

RR
Rajesh RayLead Systems Educator
Published:
5 min read
PDF Cheat Sheet
How to Install RPM Packages on Ubuntu: Alien and rpm2cpio Guide
AI Executive SummaryWebsiteVidya AI

5 min read

Learn how to install rpm packages on ubuntu using Alien to convert RPM to DEB, extract files with rpm2cpio, handle dependencies, and clean removal.

Key Highlights
  • Prerequisites and Supported Releases
  • Step 1: Understanding the Risks of Installing RPM Packages on Ubuntu
  • Step 2: Installing Alien and Build Tools via APT
Grounded in full engineering runbookWebsiteVidya AI Engine

Linux distributions primarily divide into two major packaging ecosystems: the Debian family (utilizing .deb packages managed by APT and dpkg) and the Red Hat family (utilizing .rpm packages managed by DNF and RPM).

Occasionally, proprietary software vendors, hardware driver manufacturers, or legacy enterprise applications release binary packages exclusively in RPM format, without offering a corresponding Ubuntu .deb installer.

While Ubuntu cannot natively run the RPM package database as its primary package manager, you can safely convert RPM archives into native Debian packages or extract their file contents directly.

In this tutorial, we demonstrate how to install rpm packages on ubuntu using the battle-tested alien package converter tool, extract raw archive contents via rpm2cpio, and resolve library naming mismatches.

Advertisement

Prerequisites and Supported Releases

This guide is thoroughly verified on Ubuntu 24.04 LTS (Noble Numbat) & Ubuntu 22.04 LTS. The instructions apply cleanly to cloud instances (AWS EC2, Google Compute Engine, DigitalOcean, Hetzner), bare-metal servers, and local virtual machines.

Before proceeding, ensure you have the following requirements satisfied:

  • A server or workstation running Ubuntu 24.04 LTS or Ubuntu 22.04 LTS.
  • A non-root user account with sudo administrative privileges.
  • A downloaded .rpm file on your local storage.
  • Access to a command-line terminal shell.

Step 1: Understanding the Risks of Installing RPM Packages on Ubuntu

Before converting or installing an RPM package, understand the underlying technical implications.

Advertisement

Debian and Red Hat systems utilize different naming conventions for standard C libraries, system directories, and initialization scripts.

An RPM package that expects Red Hat's httpd service may fail if installed on Ubuntu where the equivalent service is named apache2.

Never attempt to convert core system libraries (like glibc, PAM, or systemd); reserve RPM conversion strictly for standalone third-party user applications, proprietary printer drivers, or specialized enterprise utilities.

Step 2: Installing Alien and Build Tools via APT

alien is an open-source program that converts between different Linux package formats, including RPM, DEB, Stampede (.slp), and Slackware (.tgz).

Advertisement

Alien is available directly in Ubuntu's universe repository along with standard build utilities.

Update your package index and install alien along with rpm and build-essential:

# Update APT package lists:
sudo apt update

# Install Alien and RPM inspection tools:
sudo apt install -y alien rpm build-essential

# Verify Alien installation:
alien --version
# Expected output confirms: alien version 8.95 (or newer)

Step 3: Converting an RPM Package to a DEB Package with Alien

The safest workflow is converting the .rpm package into a standard .deb file first, allowing you to inspect the resulting package before installation.

Use the alien -d (or default alien) command to generate a Debian package:

Alien unpacks the RPM, maps file locations, generates Debian control metadata, and builds a new .deb package in your current directory:

# Convert RPM to DEB without installing:
sudo alien -d package_name.rpm

# Example output:
# package_name_1.0-2_amd64.deb generated

# Inspect the generated package contents using dpkg:
dpkg -c package_name_1.0-2_amd64.deb | head -n 25

Step 4: Installing the Converted DEB Package

Once Alien generates the .deb package, install it using the apt package manager.

Using apt install ./package.deb automatically checks and resolves any shared system dependencies required by the converted binary:

Execute the installation command:

# Install the newly generated .deb file using APT:
sudo apt install -y ./package_name_1.0-2_amd64.deb

# Verify that the application binary is registered and operational:
which application_name
application_name --version

Step 5: Direct One-Step Conversion and Installation (alien -i)

If you trust the RPM package and wish to convert and install it in a single command, use the -i flag.

Alien converts the package into a temporary Debian archive and invokes dpkg -i immediately:

Run the direct installation command:

# Convert and install RPM directly in a single step:
sudo alien -i package_name.rpm

# If dpkg encounters missing dependency libraries, resolve them with:
sudo apt --fix-broken install -y

Step 6: Extracting RPM Files Without Installation (rpm2cpio)

If you only need specific files, libraries, or scripts from an RPM package without registering the software into your system's package database, use rpm2cpio.

The rpm2cpio command converts the RPM archive stream into a standard cpio archive, which can be extracted into a standalone directory:

This method eliminates any risk of conflicting with Ubuntu's APT package database:

# Create an isolated extraction directory:
mkdir -p ~/extracted_rpm && cd ~/extracted_rpm

# Extract RPM contents into the current folder:
rpm2cpio /path/to/package_name.rpm | cpio -idmv

# View the extracted filesystem tree:
ls -la
# Output displays: usr/, etc/, opt/, or bin/ folders from the RPM

Troubleshooting and Common Errors

When configuring Ubuntu servers, unexpected permission errors, network timeouts, or lock contention can occur. Review these common issues and verified resolutions:

alien: command not found

Cause: The alien package is located in the Ubuntu universe component and is not installed.

Resolution: Enable the universe component and install alien: sudo add-apt-repository universe && sudo apt install -y alien.

sudo add-apt-repository universe && sudo apt install -y alien

error: Failed dependencies: /bin/sh is needed by package...

Cause: Alien attempts to evaluate RPM dependencies that use Red Hat package names not present in Ubuntu.

Resolution: Use the --nodeps flag to bypass RPM dependency checking: sudo alien -d --nodeps package.rpm.

sudo alien -d --nodeps package.rpm

Converted package breaks during execution: shared library libXYZ.so.1 not found

Cause: Ubuntu packages the required shared library under a slightly different package name or version.

Resolution: Search for the missing library using apt-file search libXYZ.so and install the corresponding Ubuntu package.

sudo apt install -y apt-file && sudo apt-file update && apt-file search libXYZ.so

Security Best Practices and Hardening

Never install unverified RPM packages downloaded from obscure forums or untrusted repositories.

Check whether an official Flatpak, Snap, AppImage, or source build exists before converting an RPM file.

Alien does not convert complex pre/post installation shell scripts by default (unless passing -g or --scripts), which can leave services unconfigured.

Deepen your Linux system administration skills with our related production-tested guides:

Authoritative References and Official Documentation

Frequently Asked Questions

Quick answers to common questions and configurations

4 FAQs
While the rpm binary can be installed via APT to query RPM files, you should never use RPM or DNF to manage system packages on Ubuntu. Ubuntu's operating system relies exclusively on the dpkg database; managing software with RPM will corrupt system package tracking.
No. Converted packages are standalone local packages and are not connected to any network repository. To update the software, you must obtain a newer RPM file, convert it, and reinstall it manually.
Query the registered package name with dpkg -l | grep package_name, then remove it using standard APT: sudo apt purge package_name.
By default, Alien strips out preinstall and postinstall scripts from RPMs to prevent Red Hat-specific system commands from breaking your Ubuntu system. Passing --scripts instructs Alien to include and attempt to convert those maintainer scripts.
RR
Written byVerified Author

Rajesh Ray

I’m Rajesh Rai, a full-stack developer, Linux administrator, and technology enthusiast passionate about making complex technology easier to understand and use.

SPAM-FREE MODERATED DISCOURSE

Join the Conversation & Perspective

Have thoughts, counterpoints, or reflections on this story? Engage directly with fellow readers and editorial contributors.

AT
MP
JV
+2

No comments on this guide yet. Be the first to share your thoughts or ask a question!

Recommended Reading10 Guides

Related Technical Guides

Tested runbooks, server administration walkthroughs, and troubleshooting guides

Featured Infrastructure PartnerUp to 75% OFF + 3 Months Free

Supercharge Your Linux & Cloud Workloads with Hostinger

Deploy high-speed NVMe KVM VPS, Docker containers, and LiteSpeed-accelerated WordPress servers in under 60 seconds with full root access, dedicated IPv4, and 24/7 technical support.

Pure NVMe SSD StorageFull Root Access & SSHFree Domain & Unlimited SSL99.9% Uptime SLA
Plans from$2.99/mo
Claim Hostinger DealAffiliate link • Special discount applied at checkout