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:
- No System Packages: NEVER use
aliento replace core system packages (e.g.,init,libc, systemd, or desktop environments). This will almost certainly break your system. - Dependencies are Ignored:
alientranslates 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. - Best Use Case:
alienis 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:
On Fedora / RHEL / CentOS:
On Arch Linux (via AUR):
2. Basic Package Conversion¶
Convert .rpm to .deb (Red Hat to Debian)¶
By default, alien converts packages into .deb format.
This outputs package_name.deb in your current directory.
To install the result:
Convert .deb to .rpm (Debian to Red Hat)¶
Use the -r or --to-rpm flag.
This outputs package_name.rpm in your current directory.
To install the result:
Convert to a Slackware Tarball (.tgz)¶
Use the -t or --to-tgz flag.
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.
(Use this with extreme caution!)
Install Automatically (-i or --install)¶
You can tell alien to automatically install the generated package immediately after converting it.
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.
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.
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.
- Convert the package, including scripts (often needed for drivers):
- Install the newly generated
.debfile:
- Check for missing dependencies (Optional but recommended):
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.