Table of Contents
This tip is about the how to Transform Linux Packages Using Alien. So read this free guide, How to Transform Linux Packages Using Alien step by step. If you have query related to same article you may contact us.
How to Transform Linux Packages Using Alien – Guide
Alien is a Linux program that switches between RPM packages, Debian packages, Stampede packages. This program is usually used when you want to use a package from another Linux distribution than the one you have configured and installed on your system. You can then use alien to transform the package into your preferred package format and install it.
Convert Linux packages using Alien
The general syntax for converting Linux packages using Alien from one format to another is:
foreign [–to-deb] [–to-rpm] [–to-tgz] [–to-slp] [options] File […]
Converting packages using Alien is very easy!
To convert a .rpm package to a .deb package, simply run alien as root or sudo user:
$ sudo alien –to-deb /path/to/file.rpm
Likewise, to convert the .deb file to .rpm, run:
$ sudo alien –to-rpm /path/to/file.deb
Here is the list of supported flags for converting Linux packages into different formats.
Let’s look at some examples. For the purpose of this guide, I will use the hello world .rpm package. Note that the hello package is packaged for almost every Linux distribution. So you don’t need to convert it. I am using it for demonstration purposes only.
Convert RPM packages to DEB packages using Alien
Now, let’s convert the hello rpm package to .deb format using Alien as below:
$ sudo alien –to-deb hello-2.10-5.fc34.x86_64.rpm
Or soon,
$ sudo alien -d hello-2.10-5.fc34.x86_64.rpm
This will convert the .rpm package to a .deb package and save the generated package in the current directory.
You can install the generated package using the default package manager.
We can also convert multiple packages at once. The following command will convert the supplied packages (hello & vim) to .deb format.
$ sudo alien hello-2.10-7.x86_64.rpm vim-enhanced-8.2.2637-1.fc34.x86_64.rpm
Convert DEB packages to RPM packages using Alien
Likewise, we can convert the .deb package into a .rpm package file as below:
$ sudo alien –to-rpm hello-2.10-5.fc34.x86_64.rpm
Or soon,
$ sudo alien -r hello-2.10-5.fc34.x86_64.rpm
Install packages automatically
Sometimes you might want to install the auto-generated packages.
To convert a package and install it automatically with Alien, use the -i flag.
$ sudo alien -d -i hello-2.10-7.x86_64.rpm
This command will convert the supplied .rpm package to the .deb package format and then install it and finally remove the generated package.
Sample output:
dpkg –no-force-overwrite -i hello_2.10-8_amd64.deb Selecting unselected package hello. (Reading the database… 52712 files and directories currently installed.) Preparing to unpack hello_2.10-8_amd64.deb… Unpacking hello (2.10-8 ) …Configuration up hello (2.10-8) … Processing triggers for man-db (2.9.4-2) …
Convert to multiple package formats
Alien can create multiple package file formats from a single package file. The following example shows how to create .deb and .tgz packages from an .rpm file.
$ sudo alien –to-deb –to-tgz hello-2.10-7.x86_64.rpm
Keep version numbers
By default, Alien adds one to the minor version number of each package it converts. For example, if the version number is 1.2-3, Alien will add one to the minor version and change it to 1.2-4.
Take a look at the following command output.
$ sudo alien –to-deb hello-2.10-7.x86_64.rpmhello_2.10-8_amd64.deb generated
The version of the source package in the above command is 2.10.7. After package conversion, Alien changed the minor version from 7 to 8 in the target file.
If you don’t want Alien to change the version number, use the -k, –keep-version flag to keep the original version number in the generated package.
$ sudo alien -k –to-deb hello-2.10-7.x86_64.rpmhello_2.10-7_amd64.deb generated
As you can see above, the source and destination file have the same version number.
Final note
I hope you like the guide How to Transform Linux Packages Using Alien. In case if you have any query regards this article you may ask us. Also, please share your love by sharing this article with your friends.