How to Convert DEB to RPM & RPM to DEB Package - Alien
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
Comments ( 1 )