• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to Convert DEB to RPM & RPM to DEB Package - Alien

230

To Convert DEB to RPM and RPM to DEB Package by Using Alien

This article is to install software in Linux by using the package management system provided by your distribution compile or utilize a tool such as dpkg or rpm with .deb and .rpm standalone etc.

In this article we introduce alien to convert between different Linux package formats, with .rpm to .deb

This tool, the alien will always probably remain in experimental status need a certain type of package to find that program in another package format.

To clarify this tool should not use to replace main system files and libraries by different set of distributions by using alien as a last resort to suggest this method to install at the beginning of this article for the question of required program.

To install Alien and Dependencies

To install alien in CentOS/RHEL 7, need to enable the EPEL and the Nux Dextop repositories.

[root@linuxhelp ~]# yum install epel-release
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centosmirror.go4hosting.in
 * extras: centosmirror.go4hosting.in
 * updates: centosmirror.go4hosting.in
[root@linuxhelp ~]# rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro

To enable this latest version of this package repository is currently 0.5.

[root@linuxhelp ~]# rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
Retrieving http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:nux-dextop-release-0-5.el7.nux   ################################# [100%]
then 

[root@linuxhelp ~]# yum update & &  yum install alien
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centosmirror.go4hosting.in
 * epel: kartolo.sby.datautama.net.id
 * extras: centosmirror.go4hosting.in
 * nux-dextop: li.nux.ro
 * updates: centosmirror.go4hosting.in

&hellip 
&hellip .
Running transaction
  Installing : alien-8.90-3.el7.nux.noarch                                  1/1 
  Verifying  : alien-8.90-3.el7.nux.noarch                                  1/1 

Installed:
  alien.noarch 0:8.90-3.el7.nux          

To convert .deb to .rpm package

In this test to choose date utils to provide a date and time to utilize a large amount of financial data.

[root@linuxhelp ~]# cat /etc/centos-release
CentOS Linux release 7.2.1511 (Core) 
wget http://ftp.us.debian.org/debian/pool/main/d/dateutils/dateutils_0.3.1-1.1_amd64.deb
--2016-03-25 01:38:30--  http://ftp.us.debian.org/debian/pool/main/d/dateutils/dateutils_0.3.1-1.1_amd64.deb
Resolving ftp.us.debian.org (ftp.us.debian.org)... 128.61.240.89, 64.50.233.100, 64.50.236.52, ...
Connecting to ftp.us.debian.org (ftp.us.debian.org)|128.61.240.89|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 214932 (210K) [application/octet-stream]
Saving to: ‘ dateutils_0.3.1-1.1_amd64.deb’ 

100%[======================================> ] 214,932      223KB/s   in 0.9s   

2016-03-25 01:38:32 (223 KB/s) - ‘ dateutils_0.3.1-1.1_amd64.deb’  saved [214932/214932]
[root@linuxhelp ~]# alien --to-rpm --scripts dateutils_0.3.1-1.1_amd64.deb
dateutils-0.3.1-2.1.x86_64.rpm generated

[root@linuxhelp ~]# ll
total 440
-rw-r--r--. 1 root root      0 Mar 25 01:40 ]
-rw-r--r--. 1 root root 214932 Nov 15  2014 dateutils_0.3.1-1.1_amd64.deb
-rw-r--r--. 1 root root 231632 Mar 25 01:42 dateutils-0.3.1-2.1.x86_64.rpm

Please note how, by default, alien increases the version minor number of the target package. If you want to override this behavior, add the &ndash keep-version flag.

Install the package right away run into a slight issue:

[root@linuxhelp ~]# rpm -Uvh dateutils-0.3.1-2.1.x86_64.rpm 
Preparing...                          ################################# [100%]
    package dateutils-0.3.1-2.1.x86_64 is already installed
    file / from install of dateutils-0.3.1-2.1.x86_64 conflicts with file from package filesystem-3.2-20.el7.x86_64
    file /usr/bin from install of dateutils-0.3.1-2.1.x86_64 conflicts with file from package filesystem-3.2-20.el7.x86_64 

To enable the epel-testing repository

To enable the epel-testing repository and to edit the settings of the package to be rebuilt by install the rpmrebuild.

[root@linuxhelp ~]# yum --enablerepo=epel-testing install rpmrebuild
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centosmirror.go4hosting.in
 * epel: epel.mirror.net.in
 * epel-testing: epel.mirror.net.in
 * extras: centosmirror.go4hosting.in
&hellip .
&hellip .
[root@linuxhelp Desktop]# rpmrebuild -pe dateutils-0.3.1-2.1.x86_64.rpm
(Converted from a deb package by alien version 8.90.)
%files
%dir %attr(0755, root, root) " /" 
%dir %attr(0755, root, root) " /usr" 
%dir %attr(0755, root, root) " /usr/bin" 
%attr(0755, root, root) " /usr/bin/dateutils.dadd" 
%attr(0755, root, root) " /usr/bin/dateutils.dconv" 
%attr(0755, root, root) " /usr/bin/dateutils.ddiff" 
%attr(0755, root, root) " /usr/bin/dateutils.dgrep" 
%attr(0755, root, root) " /usr/bin/dateutils.dround" 
%attr(0755, root, root) " /usr/bin/dateutils.dseq" 
%attr(0755, root, root) " /usr/bin/dateutils.dsort" 
%attr(0755, root, root) " /usr/bin/dateutils.dtest" 
%attr(0755, root, root) " /usr/bin/dateutils.dzone" 
%attr(0755, root, root) " /usr/bin/dateutils.strptime" 
%dir %attr(0755, root, root) " /usr/share" 
%dir %attr(0755, root, root) " /“  . /usr/share you should
delete the lines mentioned in the error message and save the file and exit.
Do you want to continue ? (y/N) y
result: /root/rpmbuild/RPMS/x86_64/dateutils-0.3.1-2.1.x86_64.rpm

we exit the file to continue with the rebuild , the file will be rebuilt in the specified directory by choosing " Y" .

result: /root/rpmbuild/RPMS/x86_64/dateutils-0.3.1-2.1.x86_64.rpm

To Install the package and verify:

[root@linuxhelp Desktop]# rpm -Uvh /root/rpmbuild/RPMS/x86_64/dateutils-0.3.1-2.1.x86_64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:dateutils-0.3.1-2.1              ################################# [100%]

[root@linuxhelp Desktop]# rpm -qa | grep dateutils
dateutils-0.3.1-2.1.x86_64

Finally, you can list the individual tools that were included with dateutils and alternatively check their respective man pages:

[root@linuxhelp Desktop]# ls -l /usr/bin | grep dateutils
-rwxr-xr-x.   1 root root     158224 Nov 15  2014 dateutils.dadd
-rwxr-xr-x.   1 root root     154128 Nov 15  2014 dateutils.dconv
-rwxr-xr-x.   1 root root     162320 Nov 15  2014 dateutils.ddiff
-rwxr-xr-x.   1 root root     178704 Nov 15  2014 dateutils.dgrep
-rwxr-xr-x.   1 root root     166416 Nov 15  2014 dateutils.dround
-rwxr-xr-x.   1 root root     158224 Nov 15  2014 dateutils.dseq
-rwxr-xr-x.   1 root root     154320 Nov 15  2014 dateutils.dsort
-rwxr-xr-x.   1 root root     150032 Nov 15  2014 dateutils.dtest
-rwxr-xr-x.   1 root root     154128 Nov 15  2014 dateutils.dzone
-rwxr-xr-x.   1 root root     150096 Nov 15  2014 dateutils.strptime

To convert .rpm to .dep package

Download the .rpm package for the zsh shell from the CentOS 6 OS repository in Ubuntu

you need to work on the Ubuntu machine for converting the .rpm to .deb , so we switch over to the Ubuntu machine.

To install alien package

user1@linuxhelp:~$ sudo apt-get install alien
sudo: unable to resolve host linuxhelp
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  debugedit librpmbuild3 librpmsign1 rpm
Suggested packages:
..
..
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up librpmbuild3 (4.11.1-3ubuntu0.1) ...
Setting up librpmsign1 (4.11.1-3ubuntu0.1) ...
Setting up debugedit (4.11.1-3ubuntu0.1) ...
Setting up rpm (4.11.1-3ubuntu0.1) ...
Setting up alien (8.90) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...

To view installed valid login shells

user1@linuxhelp:~$ cat /etc/shells 
# /etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash

Next download the .rpm package using browser we download it already,so next we convert that rpm to deb.

user1@linuxhelp:~$ cd /home/user1/Downloads/
user1@linuxhelp:~/Downloads$ ll
total 2308
drwxr-xr-x  2 user1 user1    4096 Mar 25 09:56 ./
drwxr-xr-x 17 user1 user1    4096 Mar 25 09:44 ../
-rw-rw-r--  1 user1 user1 2353606 Mar 25 09:56 zsh-4.3.10-5.el5.x86_64.rpm

user1@linuxhelp:~/Downloads$ sudo alien --to-deb --scripts zsh-4.3.10-5.el5.x86_64.rpm 
sudo: unable to resolve host linuxhelp
zsh_4.3.10-6_amd64.deb generated

You will see .deb file is generated.

user1@linuxhelp:~/Downloads$ ll
total 4264
drwxr-xr-x  2 user1 user1    4096 Mar 25 10:01 ./
drwxr-xr-x 18 user1 user1    4096 Mar 25 10:01 ../
-rw-rw-r--  1 user1 user1 2353606 Mar 25 09:56 zsh-4.3.10-5.el5.x86_64.rpm
-rw-r--r--  1 root  root  2001746 Mar 25 10:01 zsh_4.3.10-6_amd64.deb

The .deb file is generated and ready to install.

user1@linuxhelp:~/Downloads$ sudo dpkg -i zsh_4.3.10-6_amd64.deb 
sudo: unable to resolve host linuxhelp
Selecting previously unselected package zsh.
(Reading database ... 192587 files and directories currently installed.)
Preparing to unpack zsh_4.3.10-6_amd64.deb ...
Unpacking zsh (4.3.10-6) ...
Setting up zsh (4.3.10-6) ...
Processing triggers for install-info (5.2.0.dfsg.1-2) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...

After the process installation, verify that zsh is added on the list.

user1@linuxhelp:~/Downloads$ cat /etc/shells 
# /etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash
/bin/zsh

Tags:
grayson
Author: 

Comments ( 1 )

rsandu
Hello! This procedure proved extremely useful when trying to convert the already-existent .deb package of YaCy (http://yacy.net/) to a CentOS .rpm one, in order to install YaCy on CentOS hosts. An YaCy Debian package is available at http://debian.yacy.net/binary/ In the first phase, rpm complains about the / and /etc/init.d/ directory conflicts, which I'll delete in the second phase, at rpmbuild. However, afterwards it says: warning: Explicit %attr() mode not applicaple to symlink: /root/.tmp/rpmrebuild.18963/work/root/etc/yacy warning: Explicit %attr() mode not applicaple to symlink: /root/.tmp/rpmrebuild.18963/work/root/usr/share/yacy/DATA warning: Explicit %attr() mode not applicaple to symlink: /root/.tmp/rpmrebuild.18963/work/root/var/log/yacy and I don't know a correct solution for this. I am seeking to produce a good-quality, safe package for CentOS 7. Would you plase help? Thanks.
Add a comment

Frequently asked questions ( 5 )

Q

How to install Alien command in Debian (or) Ubuntu?

A

You can install Alien command on Debian (or) Ubuntu as using the following command. Syntax: "apt-get install alien".

Q

How to convert rpm to deb file using the "alien" command?

A

You can use the following syntax to convert rpm to deb file using the "alien" command. For Syntax: "alien -r libsox1_14.2.0-1_i386.deb

libsox1-14.2.0-2.i386.rpm generated".

Q

Whether its possible to Convert to SLP, LSB, Slackware TGZ packages using the "alien" command?

A

If you want to convert the different types of packages using the "alien" command, you can refer the what are the option will available for "alien" command. For Syntax: "alien --help" (or) "man alien"

Q

How to install "alien" command on CentOS 7?

A

You can use the following steps to install the "alien" package on CentOS 7.


"yum install epel-release"


"rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro"


" rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm"


"yum install alien"

Q

How can I know the entire detail and options to available for "alien" command?

A

You can use the option of "-V" withe "alien" command to know the version of "alien" command.
For Syntax: "alien -V" (or) "alien --version".

Related Tutorials in How to Convert DEB to RPM & RPM to DEB Package - Alien

Related Tutorials in How to Convert DEB to RPM & RPM to DEB Package - Alien

How to Convert DEB to RPM & RPM to DEB Package - Alien
How to Convert DEB to RPM & RPM to DEB Package - Alien
Apr 7, 2016
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Luk Van De Looverbosch ?
How to create a root ?

Hello,
How to create root@linuxhelp in Linux Mint 20.1 64-bit ?
Thanks in advance for your reply.
Best regards.

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.