Skip to content

The Comprehensive Guide to Using alien

alien is a powerful command-line tool for Linux that converts between different package formats. If you find a software package built for a different Linux distribution (like an .rpm for Fedora when you are using Debian), alien allows you to convert that package into a format your package manager can understand.

Supported Formats

alien can convert to and from the following formats:

  • Linux Standard Base (LSB): .lsb
  • Red Hat/CentOS/Fedora: .rpm
  • Debian/Ubuntu/Mint: .deb
  • Stampede: .slp
  • Solaris: .pkg
  • Slackware: .tgz

Important Warnings (Read Before Using)

Before using alien, you must understand its limitations:

  1. No System Packages: NEVER use alien to replace core system packages (e.g., init, libc, systemd, or desktop environments). This will almost certainly break your system.
  2. Dependencies are Ignored: alien translates the package archive, but it does not translate the dependency trees. You may need to manually hunt down and install required libraries after installing the converted package.
  3. Best Use Case: alien is best used for standalone, third-party applications (like specific printer drivers, proprietary software, or simple user-space utilities) that are only distributed in one format.

1. Installation

You can install alien directly from the default repositories of most major distributions.

On Debian / Ubuntu / Linux Mint:

sudo apt update
sudo apt install alien

On Fedora / RHEL / CentOS:

sudo dnf install alien

On Arch Linux (via AUR):

yay -S alien

2. Basic Package Conversion

Convert .rpm to .deb (Red Hat to Debian)

By default, alien converts packages into .deb format.

sudo alien package_name.rpm

This outputs package_name.deb in your current directory.

To install the result:

sudo dpkg -i package_name.deb
sudo apt --fix-broken install # Run this if dependencies are missing

Convert .deb to .rpm (Debian to Red Hat)

Use the -r or --to-rpm flag.

sudo alien -r package_name.deb

This outputs package_name.rpm in your current directory.

To install the result:

sudo rpm -ivh package_name.rpm
# OR
sudo dnf localinstall package_name.rpm

Convert to a Slackware Tarball (.tgz)

Use the -t or --to-tgz flag.

sudo alien -t package_name.rpm

3. Advanced Features and Flags

Include Scripts (-c or --scripts)

By default, alien does not convert the pre-install or post-install scripts included in a package (because scripts written for Debian might fail or cause damage on Fedora, and vice versa). If you trust the package and absolutely need those setup scripts to run, use the -c flag.

sudo alien -c package_name.rpm

(Use this with extreme caution!)

Install Automatically (-i or --install)

You can tell alien to automatically install the generated package immediately after converting it.

sudo alien -i package_name.rpm

Keep Original Version Number (-k or --keep-version)

By default, alien bumps the release number of the package (e.g., from 1.2-1 to 1.2-2). To prevent this and keep the exact original version number, use -k.

sudo alien -k package_name.rpm

Test the Package (-T or --test)

This will test the generated package after it is built. Note that this requires the lintian package to be installed if you are testing .deb files.

sudo alien -T package_name.rpm

4. Example Workflow: Installing an RPM Printer Driver on Ubuntu

Let's say you have an .rpm driver (printer-driver-1.0.rpm) for your printer, but you are running Ubuntu.

  1. Convert the package, including scripts (often needed for drivers):
sudo alien -c printer-driver-1.0.rpm
  1. Install the newly generated .deb file:
sudo dpkg -i printer-driver-1.0-2_amd64.deb
  1. Check for missing dependencies (Optional but recommended):
sudo apt --fix-broken install

5. Alternatives to alien

If alien fails because of complex dependencies, consider these modern alternatives:

  • Distrobox: Run any Linux distribution inside the terminal (e.g., run a Fedora container natively on Ubuntu to install RPMs).
  • Flatpak / Snap / AppImage: Universal package formats that run on any distribution without conversion.