在CcentOS系统上将deb包转换为rpm包

本文介绍如何将Ubuntu/Debian系统的deb安装包转换为适用于RedHat/CentOS/Fedora系统的rpm包,并提供详细的步骤及可能遇到的问题及其解决方案。

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

转载于:https://www.cnblogs.com/nulige/p/7607458.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值