centos 彻底卸载软件包(含依赖)并解决安装冲突包问题
1、查看yum操作事务
[root@localhost ~]# yum history list 或 yum history
Loading "fastestmirror" plugin
Config time: 0.007
Yum version: 3.4.3
ID | Login user | Date and time | Action(s) | Altered
-------------------------------------------------------------------------------
3 | root <root> | 2022-05-20 15:38 | Install | 12 EE
2 | root <root> | 2022-05-20 10:38 | I, U | 8
1 | System <unset> | 2022-05-20 10:05 | Install | 311
2、查看某个事务的详细信息
[root@localhost ~]# yum history info 3
Loaded plugins: fastestmirror
Transaction ID : 3
Begin time : Mon Jan 10 15:38:41 2022
Begin rpmdb : 318:0a512f196782814fe726bc61f44b5332aac74b38
End time : 15:38:44 2022 (3 seconds)
End rpmdb : 330:d9fb4e7bea655b40bcabffd6eb2a8a2f81110793
User : root <root>
Return-Code : Success
Command Line : install zabbix-server-mysql zabbix-agent
Transaction performed with:
Installed rpm-4.11.3-32.el7.x86_64 @anaconda
Installed yum-3.4.3-158.el7.centos.noarch @anaconda
Installed yum-plugin-fastestmirror-1.1.31-45.el7.noarch @anaconda
Packages Altered:
Dep-Install OpenIPMI-libs-2.0.23-2.el7.x86_64 @centos7
Dep-Install OpenIPMI-modalias-2.0.23-2.el7.x86_64 @centos7
Dep-Install fping-3.10-4.el7.x86_64 @epel
Dep-Install libevent-2.0.21-4.el7.x86_64 @centos7
Dep-Install net-snmp-libs-1:5.7.2-32.el7.x86_64 @centos7
Dep-Install traceroute-3:2.0.22-2.el7.x86_64 @centos7
Dep-Install unixODBC-2.3.1-11.el7.x86_64 @centos7
Dep-Install zabbix50-5.0.18-1.el7.x86_64 @epel
Install zabbix50-agent-5.0.18-1.el7.x86_64 @epel
Dep-Install zabbix50-dbfiles-mysql-5.0.18-1.el7.noarch @epel
Dep-Install zabbix50-server-5.0.18-1.el7.noarch @epel
Install zabbix50-server-mysql-5.0.18-1.el7.x86_64 @epel
Scriptlet output:
1 sed: can't read /etc/sysconfig/ipmi: No such file or directory
history info
3、卸载安装包(也就是回滚)
[root@localhost ~]# yum history undo 3
......
Removed:
OpenIPMI-libs.x86_64 0:2.0.23-2.el7 OpenIPMI-modalias.x86_64 0:2.0.23-2.el7 fping.x86_64 0:3.10-4.el7 libevent.x86_64 0:2.0.21-4.el7 net-snmp-libs.x86_64 1:5.7.2-32.el7
traceroute.x86_64 3:2.0.22-2.el7 unixODBC.x86_64 0:2.3.1-11.el7 zabbix50.x86_64 0:5.0.18-1.el7 zabbix50-agent.x86_64 0:5.0.18-1.el7 zabbix50-dbfiles-mysql.noarch 0:5.0.18-1.el7
zabbix50-server.noarch 0:5.0.18-1.el7 zabbix50-server-mysql.x86_64 0:5.0.18-1.el7
4、查看yum history help信息
[root@localhost ~]# yum history help
Loaded plugins: fastestmirror
Invalid history sub-command, use: list, info, summary, repeat, redo, undo, new, rollback, addon, addon-info, stats, statistics, sync, synchronizepkg, pkgs, pkg-list, pkgs-list, package, package-list, packages, packages-list, pkg-info, pkgs-info, package-info, packages-info.
5、当安装时提示有冲突时
Error: Package: glibc-devel-2.17-317.el7.x86_64 (c7-media)
Requires: glibc-headers = 2.17-317.el7
Installing: glibc-headers-2.17-260.el7.x86_64 (c7-media)
glibc-headers = 2.17-260.el7
Error: Package: glibc-devel-2.17-317.el7.x86_64 (c7-media)
Requires: glibc-headers = 2.17-317.el7
Available: glibc-headers-2.17-260.el7.x86_64 (c7-media)
glibc-headers = 2.17-260.el7
Error: Package: glibc-devel-2.17-317.el7.x86_64 (c7-media)
Requires: glibc = 2.17-317.el7
Installed: glibc-2.17-260.el7.x86_64 (@anaconda)
glibc = 2.17-260.el7
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
安装包冲突了,卸载掉(移除)已经安装的glibc-devel-2.17-317.el7.x86_64.rpm包即可
[root@localhost ~]#yum remove -y glibc-devel-2.17-317.el7.x86_64
版权声明:本文为m0_52425873原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。