转载自
http://www.heminjie.com/system/linux/1487.html
deb文件格式本是ubuntu/debian系统下的安装文件,那么我想要在redhat/centos/fedora中安装,需要把deb格式的软件包转化成rpm格式。
需要用到的转换工具:alien_8.89.tar.gz
1、编译安装alien_8.89.tar.gz
[root@localhost ~]# yum install perl make gcc ##安装编译所必须的软件环境
[root@localhost ~]# tar -zxvf alien_8.89.tar.gz
[root@localhost ~]# cd alien
[root@localhost alien]# perl Makefile.PL
Writing Makefile for Alien
[root@localhost alien]# make
[root@localhost alien]# make install
2、转换deb包为rpm包
[root@localhost ~]# alien -r wondershaper_1.1a-6_all.deb ##红色为要转换的deb包名称
执行后出现下面的结果就说明转换成功了,就会在当前目录下产生一下相对应的rpm包
wondershaper-1.1a-7.noarch.rpm generated
3、再安装rpm包
[root@localhost ~]# rpm -ivh wondershaper-1.1a-7.noarch.rpm
报错与解决办法:
1、在编译安装alien时可能会遇到下面报错
[root@localhost alien]# perl Makefile.PL
Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 2.
BEGIN failed--compilation aborted at Makefile.PL line 2.
执行下面命令即可解决:
[root@localhost alien]# yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
2、在执行转换命令时,报rpmbuild: command not found
[root@localhost ~]# alien -r wondershaper_1.1a-6_all.deb
Package build failed. Here's the log of the command (cd wondershaper-1.1a; rpmbuild --buildroot='/root/wondershaper-1.1a' -bb --target noarch 'wondershaper-1.1a-7.spec'):
sh: rpmbuild: command not found
yum安装rpm-build即可:
[root@localhost ~]# yum install rpm-build
个人根据上面操作的时候遇到了一个新的问题:bad ELF interpreter: No such file or directory
百度后发现是64位安装了32位的的程序执行yum install glibc.i686命令即可,此外还有安装rpm包时有个依赖包的问题
加上-nodeps参数即可,可参考https://blog.csdn.net/jinwufeiyang/article/details/52069498