Thursday, 23 August 2012

Centos 6/RHEL install and use Alien and Package Converter

Alien is occasionally useful for converting a package which you might find elusive in rpm format, from a deb, slack or other package. It should be used with care and NEVER for system critical packages. It is not an officially supported program so again, caution is advised. This is for any architecture and below there are some command line examples.

Download for Centos/RHEL 6 

alien-8.81-2.noarch.rpm                           

install it

$ sudo rpm -UVH alien-8.81-2.noarch.rpm

Fetch some needed dependencies

$ sudo yum -y install python rpm-build make m4 gcc-c++ autoconf automake redhat-rpm-config mod_dav_svn mod_ssl mod_wsgi   

Alien can be used for packages such as  pkg, tgz, lsb, deb, and rpm 

Typically, converting a deb or slack package (the most likely scenario) to rpm would be done with

$ sudo alien -r <deb_package_name>        

$ sudo alien -r <slack_package_name>   

You may also need the --scripts flag 

$ sudo alien -r --scripts <deb_package_name>

Converting other packages

$ sudo  alien --to-tgz file.pkg     Convert To TGZ Package

$ sudo alien --to-slp file.pkg      Convert To Solaris Package

The image below shows alien being used to convert a Speedcrunch deb package to a usable rpm one. (Ignore the 'find').



Converting a deb to rpm.

I'd advise not going mad with alien as you can get some unrewarding results, you may be restricted by the unavailability of dependencies which can happen a lot. It's always best to check first if there is a suitable ready built rpm or if the program can be easily compiled from source. It can be a life saver, however, if there is something you particularly want but can't get by any other means.

Package Converter (requires Alien above)

There is also available a free GUI to use with Alien called simply 'Package Converter' written in Python by Foxoman.

Once Alien is installed as above, download package-converter-3002-2noarch for any architecture, and install it with

$ sudo rpm -Uvh package-converter-3.0.0.2-2.noarch.rpm

and run it with 

$ package-converter



It has Add, Folder and Convert buttons which are pretty self explanatory and is easy to use, enabling you to convert a variety of packages from different formats. Just set the final package type & any flags such as --scripts, set the source and convert.

See Fluxbox key bindings if you are using Fluxbox, for shortcuts.

No comments:

Post a Comment