Installing Alien on CentOS 7: Convert .deb to .rpm
alien is a straightforward package converter available in EPEL that handles conversion between .deb, .rpm, Slackware, and other package formats. This is useful when you need to install Debian packages on RPM-based systems.
Prerequisites
You need EPEL (Extra Packages for Enterprise Linux) enabled. On CentOS 7, 8, or Rocky Linux 8+:
sudo dnf install epel-release
Or if you’re on an older CentOS/RHEL system without dnf:
sudo yum install epel-release
Installation
Install alien from EPEL:
sudo dnf install alien
Verify the installation:
alien --version
You should see output like:
alien version 8.95 or newer
Basic Usage
Converting a .deb to .rpm
Convert a Debian package to RPM format:
sudo alien -r package.deb
The -r flag tells alien to output an RPM file. This generates a .rpm file in your current directory that you can then install with dnf or rpm -i.
Converting with version adjustments
By default, alien may adjust the package version to be RPM-compliant. To maintain the original version number:
sudo alien -r --keep-version package.deb
Installing after conversion
After conversion, install the resulting RPM:
sudo dnf install ./package.rpm
Converting to other formats
Convert .deb to Slackware .tgz:
alien -t package.deb
Convert .rpm to .deb (less common but supported):
alien -d package.rpm
Important Considerations
Dependencies: alien converts the package structure but doesn’t resolve all dependencies. If the converted package depends on libraries not available in your RPM repositories, you’ll need to install those separately.
Testing: Always test converted packages in a non-production environment first. The conversion process can sometimes introduce issues, particularly with:
- Systemd service files
- Configuration file locations
- Library paths
Architecture mismatch: Ensure the .deb package matches your system architecture (x86_64, aarch64, etc.). Convert only packages meant for your platform.
Better alternatives: Before converting, check if the software is available directly in RPM format from the vendor or from community repositories like COPR. Native RPM packages are always preferable to converted packages.
Example: Converting a specific package
If you have example-1.0.deb and need it as an RPM:
sudo alien -r example-1.0.deb
# Creates: example-1.0-2.x86_64.rpm
sudo dnf install example-1.0-2.x86_64.rpm
Troubleshooting
If alien is not found after installation, verify EPEL is properly enabled:
dnf repolist | grep epel
If EPEL doesn’t appear in the list, re-run the EPEL installation and clear your package cache:
sudo dnf clean all
sudo dnf install epel-release
For detailed help with conversion options:
alien --help