Cyberithub

How to Install alien on Ubuntu/Debian with Example

Advertisements

In this article, we will see how to install alien on Ubuntu/Debian with example. alien is a free and open source command-line utility in Linux that converts between different package formats. It is particularly useful for users who need to install software that is only available in a package format not native to their distribution. This tool is commonly used in Debian and Ubuntu systems to convert RPM packages (used in Red Hat-based systems) to DEB format, which is compatible with Debian-based systems. It is also quite easily available for installation. Here we will see the steps to install alien on Ubuntu/Debian based systems.

 

Key Features 

  • Format Conversion: Alien can convert between several package formats, including RPM, DEB, TGZ (tar.gz), and SLK (Slackware). The most common use is to convert RPM files to DEB.
  • Script Translation: During the conversion process, alien also attempts to convert the scripts that are meant to be run before or after installing or removing the package. However, this translation isn't always perfect and may require manual adjustment.
  • Package Installation: In addition to converting packages, alien can also directly install an RPM package onto a Debian system, though this is not generally recommended.
  • Version and Package Name Handling: Alien modifies the version number of the converted package to indicate that the package has been converted. It also allows you to keep or change the package name during conversion.

 

How to Install alien on Ubuntu/Debian with Example

How to Install alien on Ubuntu/Debian with Example

Also Read: How to Install rpm on Ubuntu/Debian

Step 1: Prerequisites

a) You should have a running Ubuntu/Debian Server.

b) You should have sudo or root access to run privileged commands.

c) You should have apt or apt-get utility available in your Server.

 

Step 2: Update Your Server

As ubuntu regularly releases security fixes and bug fixes, it is important to check them periodically and install them as soon as it is available by running sudo apt update && sudo apt upgrade command as shown below. This will help protect your system from any security vulnerabilities and keep it stable and secure.

cyberithub@ubuntu:~$ sudo apt update && sudo apt upgrade
Hit:1 https://dl.google.com/linux/chrome/deb stable InRelease
Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Hit:3 https://ngrok-agent.s3.amazonaws.com buster InRelease
Hit:4 https://artifacts.elastic.co/packages/8.x/apt stable InRelease
Hit:5 https://ppa.launchpadcontent.net/libreoffice/ppa/ubuntu jammy InRelease
Hit:6 https://ppa.launchpadcontent.net/unit193/encryption/ubuntu jammy InRelease
Hit:7 http://in.archive.ubuntu.com/ubuntu jammy InRelease
Get:8 http://in.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Hit:9 http://in.archive.ubuntu.com/ubuntu jammy-backports InRelease
Fetched 229 kB in 5s (49.1 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

 

 

Step 3: Install alien

Next step is to install alien package from default Ubuntu repo by using sudo apt install alien command as shown below. This will download and install the package along with all its dependencies.

cyberithub@ubuntu:~$ sudo apt install alien
[sudo] password for cyberithub:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
autopoint build-essential debhelper debugedit dh-autoreconf dh-strip-nondeterminism dpkg-dev dwz fakeroot g++ g++-11 gettext intltool-debian
libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libarchive-cpio-perl libarchive-zip-perl libdebhelper-perl libfakeroot
libfile-stripnondeterminism-perl libfsverity0 libmail-sendmail-perl librpmbuild9 librpmsign9 libsub-override-perl libsys-hostname-long-perl
lto-disabled-list po-debconf rpm
Suggested packages:
lintian dh-make debian-keyring g++-multilib g++-11-multilib gcc-11-doc gettext-doc libasprintf-dev libgettextpo-dev libmail-box-perl elfutils rpmlint
rpm-i18n
The following NEW packages will be installed:
alien autopoint build-essential debhelper debugedit dh-autoreconf dh-strip-nondeterminism dpkg-dev dwz fakeroot g++ g++-11 gettext intltool-debian
libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libarchive-cpio-perl libarchive-zip-perl libdebhelper-perl libfakeroot
libfile-stripnondeterminism-perl libfsverity0 libmail-sendmail-perl librpmbuild9 librpmsign9 libsub-override-perl libsys-hostname-long-perl
lto-disabled-list po-debconf rpm
0 upgraded, 31 newly installed, 0 to remove and 0 not upgraded.
Need to get 15.7 MB of archives.
After this operation, 40.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://in.archive.ubuntu.com/ubuntu jammy/main amd64 autopoint all 0.21-4ubuntu4 [422 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu jammy/main amd64 libdebhelper-perl all 13.6ubuntu1 [67.2 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu jammy/main amd64 dh-autoreconf all 20 [16.1 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu jammy/main amd64 libarchive-zip-perl all 1.68-1 [90.2 kB]
.............................................................

 

 

Step 4: Check Version

You can also check the current installed version by using alien --version command as shown below.

cyberithub@ubuntu:~$ alien --version
alien version 8.95.5

 

 

Step 5: Verify Installation

After successful installation, you can verify the installation status by running dpkg -s alien command as shown below. To know more about dpkg usage, check 21+ Practical dpkg Command Examples for Linux Beginners.

cyberithub@ubuntu:~$ dpkg -s alien
Package: alien
Status: install ok installed
Priority: optional
Section: admin
Installed-Size: 163
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: all
Version: 8.95.5
Depends: debhelper (>= 10), perl:any, rpm (>= 2.4.4-2), dpkg-dev, make, cpio, rpm2cpio
Suggests: patch, bzip2, lintian, lzma
Description: convert and install rpm and other packages
Alien allows you to convert LSB, Red Hat, Stampede and Slackware Packages
into Debian packages, which can be installed with dpkg.
.
It can also generate packages of any of the other formats.
.
This is a tool only suitable for binary packages.
Original-Maintainer: Debian QA Group <packages@qa.debian.org>
Homepage: http://kitenet.net/~joey/code/alien/

 

 

Step 6: Using alien

Now that alien utility is installed and ready, let's use it to convert a rpm package to debian package. For our demonstration, we have a libc6 rpm package available in our system. We are converting this to debian package by using sudo alien -d libc6-2.38-5-omv2490.x86_64.rpm command as shown below. As you can see, it generated a debian package called libc6_2.38-6_amd64.deb in the current working directory which is now a suitable one to be installed using dpkg package manager on Ubuntu or debian based systems.

NOTE:

Please note that installing incompatible package can sometimes break your system completely and may result in kernel panic error post reboot. Hence it is important for you to be careful in choosing a rpm package which you are installing after converting it to a debian package.
cyberithub@ubuntu:~$ sudo alien -d libc6-2.38-5-omv2490.x86_64.rpm
libc6_2.38-6_amd64.deb generated

 

 

Step 7: Check all available options

You can explore all options available with alien utility using alien --help command as shown below.

cyberithub@ubuntu:~$ alien --help
Usage: alien [options] file [...]
  file [...]                Package file or files to convert.
  -d,  --to-deb             Generate a Debian deb package (default).
    Enables these options:
      --patch=<patch>       Specify patch file to use instead of automatically
                            looking for patch in /var/lib/alien.
      --nopatch             Do not use patches.
      --anypatch            Use even old version os patches.
      -s, --single          Like --generate, but do not create .orig
                            directory.
      --fixperms            Munge/fix permissions and owners.
      --test                Test generated packages with lintian.
  -r, --to-rpm          Generate a Red Hat rpm package.
      --to-slp Generate a Stampede slp package.
  -l, --to-lsb Generate a LSB package.
  -t, --to-tgz Generate a Slackware tgz package.
..............................................

 

Step 8: Uninstall alien

When not using, you can also choose to uninstall alien utility from your system by using sudo apt remove alien command as shown below. To remove all dependencies, use --auto-remove option with below command cautiously.

cyberithub@ubuntu:~$ sudo apt remove alien
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libfsverity0 librpmbuild9 librpmsign9 rpm
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
alien
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 167 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 239392 files and directories currently installed.)
Removing alien (8.95.5) ...
Processing triggers for man-db (2.10.2-1) ...

Leave a Comment