The alien command is used by almost all system administrators. You might come across situations where you may need to install a .deb package on an OpenSUSE machine. You will need to convert it to a .rpm prior to doing the installation. The alien command is simply a way to convert or install an alien binary package.
Installing Alien on OpenSUSE Leap
A general idea of how to install a .deb package on an OpenSUSE by converting it to a .rpm file can be done with the command alien. If you have freshly install OpenSUSE Leap, you might notice that command zypper install alien gives you the following error.
This can be solved easily as there is no repositories available. You can just jump on the Kamikaz Repo of the openSUSE factory. and fire the following commands :
zypper addrepo http://download.opensuse.org/repositories/home:KAMiKAZOW/openSUSE_Leap_42.1/home:KAMiKAZOW.repo zypper refresh zypper install alien
You would have a result similar to this with all the dependencies installed.
You can finally launched the zypper install alien which will look similar to this.
Let’s now convert a .deb into a .rpm
I will take the example of the nmap tool. I have downloaded the nmap .deb file from the Ubuntu repo. You can choose your own deb file. This is the link to download the nmap from the Ubuntu repo.
So to convert the file into a .rpm you need to launch the following command
alien --to-rpm <deb file name here>
Of course, on an openSUSE machine you would need the spec file. Here is an idea what kind of error you might came across.
Solving the error
The error “rpmbuild not found” clearly give a hint that the package rpmbuild is not found on the machine. Just install in with :
zypper install rpmbuild
Now that the rpmbuild package is installed with all the dependencies you can relaunch the command which in my case is
alien --to-rpm nmap_7.01-2ubuntu1_amd64.deb
A nice message message where the package.rpm is generated will be prompted. I have just taken the nmap package as a example. It’s generally inadvisable to run alien on a machine having both RPMs and DEBs package because the two systems do not share installed-file database information. You can chose your own .deb file. Have funs with aliens.