在CentOS上----如何對deb與rpm包進行轉換
centos、redhat等默認使用的是rpm包格式。而許多軟件只有rpm或者deb包,如其他系統需要使用,就需要我們進行對包格式的轉換,下面介紹在CentOS上,如何對deb與rpm包進行轉換;
1. 配置centos yum源
下載yum配置文件
[root@DESKTOP-L9O2H6T yum.repos.d]# sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
下載epel源配置文件
[root@DESKTOP-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 makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
...............................................................
(10/10): updates/7/x86_64/primary_db | 27 MB 00:00:04
Metadata Cache Created
2.安裝Alien
[root@DESKTOP-L9O2H6T yum.repos.d]# yum install alien
安裝完成驗證版本
[root@DESKTOP-L9O2H6T yum.repos.d]# alien --version
alien 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

關注小張的知識雜貨鋪,讓我們一起學習一起進步

浙公網安備 33010602011771號