Home » 2015 » June » 16 » Alien command : convert files from one form to another, install binary packages

10:23 AM
Alien command : convert files from one form to another, install binary packages

ALIEN - Convert FILES from/to rpm, lsb, deb, solaris packages or install an alien binary package.

FORMAT
        alien [--to-deb] [--to-rpm] [--to-tgz] [--to-slp] [options] file [...]


DESCRIPTION
       alien is a command line utility that converts between Red Hat rpm, Debian deb, Stampede slp, Slackware tgz, and Solaris pkg file formats to/from one another.

If you want to use a package from another linux distribution than the one you have installed on your system, you have to use alien to convert it to your preferred package format and install it.

It also supports LSB packages.

Eg. To install rpm package you need to first convert it into debian package.-

shankar-desktop Downloads # rpm -ivh yum-3.4.3-506.fc23.noarch.rpm
rpm: please use alien to install rpm packages on Debian, if you are really sure use --force-debian switch. See README.Debian for more details.

 


 

Some requirements:

rpm: For converting to and from rpm format the Red Hat Package Manager(rpm) must be installed.

lsb: Unlike the other package formats, alien can handle the dependencies of lsb packages if the destination package format supports dependencies.
           

Note that this means that the package generated from a lsb package will depend on a package named "lsb" -- your distribution should provide a package by that name, if it is lsb compliant. The scripts in the lsb package will be converted by default as well.

           To generate lsb packages, the Red Hat Package Manager must be installed, and alien will use by preference a program named lsb-rpm, if it exists.  No guarantees are made that the generated lsb packages will be fully LSB compliant, and it's rather unlikely they will unless you build them in the lsbdev environment.

           Note that unlike other package formats, converting an LSB package to another format will not cause its minor version number to be changed.

deb:

For converting to (but not from) deb format, the gcc, make, debhelper, dpkg-dev, and dpkg packages must be installed.


Available Options
       alien will convert all the files you pass into it into all the output types you specify. If no output type is specified, it defaults to converting to deb format.

       file [...]
           The list of package files to convert.

       -d, --to-deb
           Make debian packages. This is the default.

shankar-desktop Downloads # alien -d -c yum-3.4.3-506.fc23.noarch.rpm
warning: yum-3.4.3-506.fc23.noarch.rpm: Header V3 RSA/SHA1 signature: NOKEY, key ID 873529b8
error: incorrect format: unknown tag

warning: yum-3.4.3-506.fc23.noarch.rpm: Header V3 RSA/SHA1 signature: NOKEY, key ID 873529b8
yum_3.4.3-507_all.deb generated
shankar-desktop Downloads # 

 

Now we can install the deb package on debian Linux.

 

shankar-desktop Downloads # dpkg -i yum_3.4.3-507_all.deb
(Reading database ... 113844 files and directories currently installed.)
Preparing to replace yum 3.2.25-1ubuntu2 (using yum_3.4.3-507_all.deb) ...
Unpacking replacement yum ...
Setting up yum (3.4.3-507) ...
Installing new version of config file /etc/logrotate.d/yum ...
Processing triggers for python-support ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
shankar-desktop Downloads # 

 

       -r, --to-rpm
           Make rpm packages.

shankar-desktop Downloads # alien -r yum_3.4.3-507_all.deb
tar: Record size = 8 blocks
Warning: Skipping conversion of scripts in package yum: postinst postrm prerm
Warning: Use the --scripts parameter to include the scripts.
yum-3.4.3-508.noarch.rpm generated

shankar-desktop Downloads # ll yum-3.4.3-508.noarch.rpm
-rw-r--r-- 1 root root 1770896 2015-06-13 22:11 yum-3.4.3-508.noarch.rpm

 

       -t, --to-tgz
           Make tgz packages.

shankar-desktop Downloads # alien -t -c yum-3.4.3-506.fc23.noarch.rpm
warning: yum-3.4.3-506.fc23.noarch.rpm: Header V3 RSA/SHA1 signature: NOKEY, key ID 873529b8
error: incorrect format: unknown tag
warning: yum-3.4.3-506.fc23.noarch.rpm: Header V3 RSA/SHA1 signature: NOKEY, key ID 873529b8
yum-3.4.3.tgz generated
shankar-desktop Downloads # ll yum-3.4.3.tgz
-rw-r--r-- 1 root root 1769935 2015-06-13 22:14 yum-3.4.3.tgz

 

       --to-slp
           Make slp packages.

       -p, --to-pkg
           Make Solaris pkg packages.

       -i, --install

  • Automatically install each generated package, and remove the package file after it has been installed.
  • The below command first converts the rpm package into debian package and then install it. Also the deb package is removed once it is installed.

shankar-desktop Downloads # alien -i vsftpd-3.0.2-21.1.i586.rpm
warning: vsftpd-3.0.2-21.1.i586.rpm: Header V3 RSA/SHA256 signature: NOKEY, key ID 3dbdc284
error: incorrect format: unknown tag
Warning: Skipping conversion of scripts in package vsftpd: postinst postrm preinst prerm
Warning: Use the --scripts parameter to include the scripts.
warning: vsftpd-3.0.2-21.1.i586.rpm: Header V3 RSA/SHA256 signature: NOKEY, key ID 3dbdc284
    dpkg --no-force-overwrite -i vsftpd_3.0.2-22.1_i386.deb
Selecting previously deselected package vsftpd.
(Reading database ... 113937 files and directories currently installed.)
Unpacking vsftpd (from vsftpd_3.0.2-22.1_i386.deb) ...
Setting up vsftpd (3.0.2-22.1) ...
Processing triggers for man-db ...

 

To check if the package is installed or not, we can use below command

shankar-desktop ~ # apt-cache policy vsftpd
vsftpd:
  Installed: 3.0.2-22.1
  Candidate: 3.0.2-22.1
  Version table:
 *** 3.0.2-22.1 0
        100 /var/lib/dpkg/status
     2.2.2-3ubuntu6.3 0
        500 http://archive.ubuntu.com/ubuntu/ lucid-updates/main Packages
        500 http://security.ubuntu.com/ubuntu/ lucid-security/main Packages
     2.2.2-3ubuntu6 0
        500 http://archive.ubuntu.com/ubuntu/ lucid/main Packages

   -c, --scripts
           Try to convert the scripts that are meant to be run when the package is installed and removed. Use this with caution, because these scripts might be designed to work on a system unlike your own, and could cause problems.

It is recommended that you examine the scripts by hand and check to see what they do before using this option.

Example of -c is shown above.

 

 

 
 

Category: Open System-Linux | Views: 1134 | Added by: shanky | Tags: convert file from deb to rpm, RPM, unix, Alien, convert file formats, convert file from rpm to deb, linux, deb package | Rating: 5.0/1

Related blogs


You may also like to see:


[2014-11-25][Open System-Linux]
DMESG command in Linux : to display or control kernel ring buffer
[2015-04-23][Open System-Linux]
15 Great DATE command examples
[2014-12-16][Open System-Linux]
CUT command in Linux : cut the file vertically
[2014-02-23][Open System-Linux]
lwp-download: A command in linux to downlaod large files from internet
[2014-10-25][Open System-Linux]
XMLWF command in Linux to check/validate/parse an XML file

Total comments: 0
avatar