centos 安装deb格式安装包

背景

研发给了我一个deb包,需要我在centos 这种服务器操作系统上安装...

deb包安装一般是使用dpkg -i xxxx.deb 命令,dpkg是Debian类型的系统,但是 通常centos是没有dpkg命令的...

直接就报:bash dpkg 未找到命令...

本来找研发给我编译rpm的包,结果还是没给我。 那就试试另外的方法吧。

处理办法

1、安装alien

yum install alien

alien 是什么? 是一款可用于转换deb\rpm 的程序,官方介绍如下:

DESCRIPTION
       alien is a program that converts between Red Hat rpm, Debian deb, Stampede slp, Slackware tgz, and Solaris pkg file formats. If you want to use a package from another linux distribution than the one you have installed on your
       system, you can use alien to convert it to your preferred package format and install it. It also supports LSB packages.
 

2、通过alien命令转换test软件包为rpm格式

通过man alien命令可以查看alien命令的帮助信息,通过帮助信息可得知 alien -r 命令:


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

详细选项可参考如下:

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.

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

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

       --to-slp
           Make slp packages.

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

是可以实现deb向rpm的转换的。

因此deb向rpm转换,只需要执行命令alien -r xxx.deb 就可以生成同名的rpm包:

网上有人说命令是:alien -r xxx.deb generated 实测是有问题的,就像上图一样,会报错,只需要 alien -r xxx.deb 就可以自动转换了。

3、测试转换成的rpm安装包

rpm -ivh xxx.rpm   

如果包没有问题,那么就ok了,如果报错就具体问题具体分析吧。

哈哈哈哈。。。。反正我没成功,我找研发去了。。。。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值