在CentOS上如何对deb与rpm包进行转换

Linux

centos、redhat等默认使用的是rpm包格式。而许多软件只有rpm或者deb包,如其他系统需要使用,就需要我们进行对包格式的转换,下面介绍在CentOS上,如何对deb与rpm包进行转换;

1. 配置centos yum源

下载yum配置文件

[root@L9O2H6T yum.repos.d]# sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

下载epel源配置文件

[root@L9O2H6T yum.repos.d]# sudo wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

重建本地缓存

[root@DESKTOP-L9O2H6T yum.repos.d]# yum clean all............[root@DESKTOP-L9O2H6T yum.repos.d]# yum makecacheLoaded plugins: fastestmirrorDetermining fastest mirrors * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.combase                                                                                                                                                                  | 3.6 kB  00:00:00extras                                                                                                                                                                | 2.9 kB  00:00:00updates                                                                                                                                                               | 2.9 kB  00:00:00...............................................................(10/10): updates/7/x86_64/primary_db                                                                                                                                  |  27 MB  00:00:04Metadata Cache Created

2.安装Alien

[root@L9O2H6T yum.repos.d]# yum install alien

安装完成验证版本

[root@DESKTOP-L9O2H6T yum.repos.d]# alien --versionalien version 8.95

3.Alien转换

将deb转换成rpm包

alien --to-rpm --scripts unispherecli-linux-64-x86-en-us_5.3.0.1983481-2_amd64.deb

将rpm转换成deb包

alien --to-deb --script UnisphereCLI-Linux-64-x86-en_US-5.3.0.1983481-1.x86_64.rpm 

4.安装

安装RPM包

rpm -ivh UnisphereCLI-Linux-64-x86-en_US-5.3.0.1983481-1.x86_64.rpm

安装deb包

dpkg -i unispherecli-linux-64-x86-en-us_5.3.0.1983481-2_amd64.deb

注:CPU架构需一致,如x86的包不能用于ARM。

本文链接:https://www.orcy.net.cn/4278.html,转载请附上原文出处链接

暂无评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注