Convert Linux Packages Between DEB, RPM, TGZ, SLP, and PKG Formats with Alien
Learn how to use Alien to convert Linux packages between DEB, RPM, TGZ, SLP, and Solaris PKG formats, install the result, and handle compatibility risks.
Linux distributions use different package formats and package-management tools. Debian and Ubuntu commonly use DEB packages, while Red Hat-derived distributions commonly use RPM packages. A package file is an archive containing software files plus metadata such as dependencies, version information, architecture, and installation scripts.
Alien is a command-line utility that translates package files between several formats. It is useful when an application is available as a package for another distribution family but no suitable package exists for the system you are using.
When package conversion makes sense
Prefer the target distribution's own repositories, a vendor package built for that distribution, or a source build whenever one is available. These options generally provide better dependency handling, upgrade support, service integration, and removal behavior.
Alien is a fallback for situations such as receiving an RPM while working on a Debian-family system, or receiving a DEB while working on an RPM-based system. It can also produce TGZ, Stampede SLP, and Solaris PKG output where the installed Alien version supports those formats.
A successful conversion means that Alien created a package in the requested format. It does not prove that the application will install, start, or operate correctly.
Package formats supported by Alien
- DEB: the binary package format used by Debian and related distributions.
- RPM: a package format and package-management ecosystem used by Red Hat-derived and other Linux distributions.
- TGZ: a gzip-compressed tar archive. It can contain files, but it does not automatically provide the package-manager integration of DEB or RPM.
- SLP: the Stampede Linux package format, supported by applicable Alien versions.
- Solaris PKG: a package format used by Solaris systems, available with Alien's PKG output option where supported.
DEB is Alien's default output format when no output option is supplied. Therefore, alien package.rpm normally attempts to produce a DEB package.
Prerequisites and supporting tools
- Install Alien with the target system's native package manager before attempting conversion.
- Conversions involving DEB require applicable Debian packaging tools, including tools such as
dpkgwhere needed. - Conversions involving RPM require applicable RPM tools, including
rpmwhere needed. cpiomay be required for RPM-related extraction or conversion workflows.- Ordinary conversion should normally be performed as an unprivileged user in a working directory you control.
- Installing the result usually requires administrative privileges through
sudo. The root account is the administrative account, but direct root login is not necessary for the examples below.
If the alien command is unavailable, install Alien through the distribution's package manager, then open a new shell or verify that the executable is in your PATH.
Alien command syntax
alien [options] package-file
The input is a local package file. Options select the output format. Alien normally writes the converted file in the current working directory, so first move into a dedicated working directory and confirm the resulting filename afterward.
mkdir package-conversion
cd package-conversion
alien --to-deb source-package.rpm
Do not assume that the output filename exactly matches the input filename. Alien derives names and metadata from the source package, and some fields do not map perfectly between formats.
Alien output format options
Converting an RPM to a DEB
This example converts an Nmap RPM file to a DEB package. Replace the filename with the actual local file you received.
alien --to-deb nmap.rpm
The short form is equivalent:
alien -d nmap.rpm
List the working directory to identify the generated DEB:
ls -l
Inspect its metadata before installation when possible:
dpkg-deb -I nmap_*.deb
dpkg-deb -c nmap_*.deb
The first command displays package metadata, including dependencies and architecture. The second lists the files that would be installed.
Install the converted package with the low-level Debian package tool, dpkg:
sudo dpkg -i nmap_*.deb
If dpkg reports missing dependencies, do not simply ignore the error. Find target-native packages that provide the required libraries or capabilities and use the Debian-family package-management tools to resolve the dependency state. Dependency names from the RPM may not match Debian package names.
nmap --version
Use a version command or another basic functional test to validate the installation.
Converting a DEB to an RPM
To convert a local DEB into an RPM, explicitly select RPM output:
alien --to-rpm package.deb
The short form is:
alien -r package.deb
Identify the generated RPM and inspect its metadata:
ls -l
rpm -qip package-*.rpm
rpm -qpl package-*.rpm
rpm -qip queries package information without installing it. rpm -qpl lists the files in the package.
Install the local RPM with rpm:
sudo rpm -i package-*.rpm
RPM may report missing libraries, capabilities, or packages. Supply those requirements with packages appropriate for the target RPM-based distribution. A package name from the Debian source package may not exist under the same name on the target system.
Other output formats
Alien can generate formats other than DEB and RPM when the installed version supports them:
alien --to-tgz package-file
alien --to-slp package-file
alien --to-pkg package-file
These commands create TGZ, Stampede SLP, or Solaris PKG output respectively. Consult the installed command's help and documentation for format-specific limitations. A TGZ archive is not equivalent to a distribution-managed package: it may lack dependency tracking, upgrade metadata, service registration, and clean removal support.
Conversion and installation commands by target format
A safer validation workflow
- Find a native alternative first. Search the target distribution's repositories, the software vendor's release channels, or a supported source-build method.
- Verify the source. Confirm where the package came from. Check its checksum and signature when the publisher provides them.
- Check architecture and version. A package built for a different CPU architecture cannot be made compatible merely by changing DEB to RPM or RPM to DEB.
- Convert as an unprivileged user. Keep the original package and generated output in a dedicated working directory.
- Inspect metadata and contents. Review the name, version, architecture, dependencies, scripts, and file list before installation.
- Confirm dependencies. Identify target-native packages that provide the required libraries and capabilities.
- Install with the target package tool. Use
dpkgfor a local DEB orrpmfor a local RPM, withsudowhen required. - Validate operation. Run the program's version command, check service status if applicable, and perform a basic functional test.
- Record the method. Keep the original package, converted filename, source information, and installation details so that future updates and removal can be planned.
Risks and limitations
Kernel modules are especially sensitive because they depend on the running kernel, compiler interfaces, architecture, and distribution configuration. Conversion cannot solve those requirements.
Troubleshooting
alien is not found
Alien may not be installed, or its executable may not be in the current shell's PATH. Install it using the target distribution's package manager, then verify the command in a new shell.
A helper such as rpm, dpkg, or cpio is missing
Install the packaging and archive utilities required for the source and destination formats. For example, DEB/RPM conversions may need tools from both packaging ecosystems. Retry only after confirming that the helper commands are available.
The converted package has missing dependencies
Dependency names may differ, the required library version may not exist, or the package may expect a different base system. Locate target-native packages that satisfy the requirements. If they cannot be resolved cleanly, use a native package, vendor build, source build, container, or virtual machine instead.
Installation reports an architecture mismatch
Obtain a package built for the target CPU architecture. Alien changes package format, not architecture.
The package installs, but the program or service fails
Review shared-library errors, package scripts, service-manager configuration, users, paths, and system logs. If the conversion leaves the system inconsistent, remove the converted package using the target package tools and switch to a supported installation method.
The generated filename or version is unexpected
List the working directory and inspect the generated metadata. Alien derives output naming and metadata from the source package, and not every field maps exactly to the destination format.
Exam-relevant notes
- Alien translates package archives; it does not turn foreign software into a fully supported native package.
- DEB is the default output when no explicit output option is provided.
- Use
--to-debor-dfor DEB,--to-rpmor-rfor RPM,--to-tgzor-tfor TGZ,--to-slpfor SLP, and--to-pkgor-pfor Solaris PKG. - Use
dpkg -ito install a local DEB andrpm -ito install a local RPM. - Package-format conversion does not solve dependency, ABI, service, script, lifecycle, or architecture incompatibilities.
Summary
Alien is useful for translating supported Linux package formats when a native package is unavailable. The basic pattern is alien [options] package-file, followed by metadata inspection, installation with the target package tool, dependency resolution, and functional validation. Treat the converted file as an interoperability aid rather than proof of compatibility, and prefer native repositories or supported builds whenever possible.
For related shell skills, see Linux command-line lessons, showing the full path of shell commands, and Bourne Again Shell Bash.