rpm必知100问:如何模拟安装rpm包?

模拟安装 RPM 包可以帮助你在实际安装之前检查依赖关系、冲突和其他潜在问题,而不会对系统进行任何实际的更改。

使用 rpm 命令模拟安装

rpm 提供了 --test 选项,可以在不实际修改系统的情况下测试安装过程。这个选项会显示所有检测到的问题(如依赖性问题或文件冲突),但不会对系统做出任何实际更改。

用法:
sudo rpm -ivh --test example.rpm
  • -i:表示安装。
  • -v:显示详细信息。
  • -h:显示进度条。
  • --test:仅测试安装,不实际执行安装操作。
实例

提前发现了冲突!

[root@localhost test]# rpm -ivh --test sysstat-11.7.3-13.0.1.an8.x86_64.rpm
Verifying...                          ################################# [100%]
准备中...                          ################################# [100%]
        file /usr/bin/cifsiostat from install of sysstat-11.7.3-13.0.1.an8.x86_64 conflicts with file from package sysstat-11.7.3-11.0.1.an8.x86_64
        file /usr/bin/iostat from install of sysstat-11.7.3-13.0.1.an8.x86_64 conflicts with file from package sysstat-11.7.3-11.0.1.an8.x86_64
        file /usr/bin/mpstat from install of sysstat-11.7.3-13.0.1.an8.x86_64 conflicts with file from package sysstat-11.7.3-11.0.1.an8.x86_64
        file /usr/bin/pidstat from install of sysstat-11.7.3-13.0.1.an8.x86_64 conflicts with file from package sysstat-11.7.3-11.0.1.an8.x86_64
        file /usr/bin/sadf from install of sysstat-11.7.3-13.0.1.an8.x86_64 conflicts with file from package sysstat-11.7.3-11.0.1.an8.x86_64
        file /usr/bin/sar from install of sysstat-11.7.3-13.0.1.an8.x86_64 conflicts with file from package sysstat-11.7.3-11.0.1.an8.x86_64
        file /usr/bin/tapestat from install of sysstat-11.7.3-13.0.1.an8.x86_64 conflicts with file from package sysstat-11.7.3-11.0.1.an8.x86_64
        file /usr/lib64/sa/sa1 from install of sysstat-11.7.3-13.0.1.an8.x86_64 conflicts with file from package sysstat-11.7.3-11.0.1.an8.x86_64
        file /usr/lib64/sa/sadc from install of sysstat-11.7.3-13.0.1.an8.x86_64 conflicts with file from package sysstat-11.7.3-11.0.1.an8.x86_64
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值