欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 健康 > 美食 > centos 安装deb格式安装包

centos 安装deb格式安装包

2024/10/24 10:14:21 来源:https://blog.csdn.net/yeyuningzi/article/details/139951240  浏览:    关键词: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了,如果报错就具体问题具体分析吧。

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

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com