yum卸载软件以及依赖,回滚事务 现在的 yum 带有历史记录功能,可以查看过往的事务,重做或回滚这些事务. 显示事务的命令是 “yum history”, 在历史中搜索某个软件包是“yum history list XXXX”, 显示某个事务的详细信息用 “yum history info N” , N是事务编号, 重做是 “yum history redo N”, 回滚是 “yum history undo N” 回滚到安装这个软件之前的状态,相当于卸载软件以及其所带的依赖包 (再也不用因为下错版本带了一大堆依赖包而犯愁了 :) 利用 yum history 可以更好的管理已进行的 yum 操作。 在/var/log/yum.log 中也有yum安装历史记录
[root@bogon ml2]# yum history Loaded plugins: fastestmirror, langpacks ID | Command line | Date and time | Action(s) | Altered ------------------------------------------------------------------------------- 88 | install openstack-neutro | 2020-06-10 17:23 | I, U | 6 EE 87 | -y install openstack-das | 2020-06-06 19:15 | I, U | 2 P< 86 | install libffi-devel -y | 2020-06-05 09:46 | I, U | 2 > 85 | install openstack-ironic | 2020-06-04 12:09 | Install | 3 < 84 | -y install openstack-iro | 2020-06-04 12:01 | Install | 2 >< 83 | -y install openstack-iro | 2020-06-04 11:53 | Install | 1 >< 82 | -y install openstack-iro | 2020-06-04 11:37 | Install | 1 >< 81 | install openstack-ironic | 2020-06-04 09:49 | I, U | 12 > 80 | -y update python-ironic- | 2020-06-04 09:42 | Update | 1 EE 79 | -y install openstack-iro | 2020-06-03 20:04 | Install | 1 < 78 | install -y openstack-iro | 2020-06-03 16:28 | Install | 2 >< 77 | -y install python3 | 2020-06-03 15:57 | Install | 4 > 76 | -y install openstack-iro | 2020-06-03 11:54 | Update | 3 EE 75 | localinstall -y /root/rp | 2020-05-20 21:28 | Install | 1 74 | install -y python-sphinx | 2020-05-20 21:26 | I, U | 3 EE 73 | install -y python-six se | 2020-05-20 18:08 | I, U | 30 72 | install libguestfs-tools | 2020-05-08 17:26 | Update | 5 71 | -y install python-virtua | 2020-03-05 13:52 | Install | 1 < 70 | install -y python-virtua | 2020-03-05 13:32 | Install | 1 > 69 | install https://www.elre | 2020-02-28 10:46 | Install | 1 history list [root@bogon ml2]# yum history list openstack-neutron Loaded plugins: fastestmirror, langpacks ID | Login user | Date and time | Action(s) | Altered ------------------------------------------------------------------------------- 88 | root <root> | 2020-06-10 17:23 | I, U | 6 EE 18 | kylin <kylin> | 2019-07-22 15:27 | Install | 43 history list [root@bogon ml2]# yum history info 18 Loaded plugins: fastestmirror, langpacks Transaction ID : 18 Begin time : Mon Jul 22 15:27:38 2019 Begin rpmdb : 706:d43efd9e9c672558d836ca62309165878d155ccb End time : 15:27:51 2019 (13 seconds) End rpmdb : 749:9a9d01c3b504a96b18b33453721ec9768d9dd47d User : kylin <kylin> Return-Code : Success Command Line : install openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge python-neutronclient ebtables ipset -y Transaction performed with: Updated rpm-4.11.3-35.el7.aarch64 @anaconda Installed yum-3.4.3-161.el7.centos.noarch @anaconda Installed yum-plugin-fastestmirror-1.1.31-50.el7.noarch @anaconda Packages Altered: Dep-Install c-ares-1.10.0-3.el7.aarch64 @base Dep-Install conntrack-tools-1.4.4-4.el7.aarch64 @base Dep-Install dibbler-client-1.0.1-0.RC1.2.el7.aarch64 @centos-openstack-queens Dep-Install dnsmasq-utils-2.76-7.el7.aarch64 @base Dep-Install haproxy-1.5.18-8.el7.aarch64 @base Install ipset-6.38-3.el7_6.aarch64 @updates Dep-Install ipset-libs-6.38-3.el7_6.aarch64 @updates Dep-Install keepalived-1.3.5-8.el7_6.aarch64 @updates Dep-Install libev-4.15-7.el7.aarch64 @extras Dep-Install libnetfilter_cthelper-1.0.0-9.el7.aarch64 @base Dep-Install libnetfilter_cttimeout-1.0.0-6.el7.aarch64 @base Dep-Install libnetfilter_queue-1.0.2-2.el7.aarch64 @base Dep-Install libsodium-1.0.18-1.el7.aarch64 @epel Dep-Install libxslt-python-1.1.28-5.el7.aarch64 @base Dep-Install lm_sensors-libs-3.4.0-6.20160601gitf9185e5.el7.aarch64 @base Dep-Install net-snmp-agent-libs-1:5.7.2-37.el7.aarch64 @base Dep-Install net-snmp-libs-1:5.7.2-37.el7.aarch64 @base Dep-Install openpgm-5.2.122-2.el7.aarch64 @centos-openstack-queens Install openstack-neutron-1:12.1.0-1.el7.noarch @centos-openstack-queens Dep-Install openstack-neutron-common-1:12.1.0-1.el7.noarch @centos-openstack-queens Install openstack-neutron-linuxbridge-1:12.1.0-1.el7.noarch @centos-openstack-queens Install openstack-neutron-ml2-1:12.1.0-1.el7.noarch @centos-openstack-queens Dep-Install python-beautifulsoup4-4.6.0-1.el7.noarch @centos-openstack-queens Dep-Install python-logutils-0.3.3-3.el7.noarch @centos-ceph-luminous Dep-Install python-neutron-1:12.1.0-1.el7.noarch @centos-openstack-queens Dep-Install python-ryu-common-4.15-1.el7.noarch @centos-openstack-queens Dep-Install python-waitress-0.8.9-5.el7.noarch @centos-openstack-queens Dep-Install python-webtest-2.0.23-1.el7.noarch @centos-openstack-queens Dep-Install python-werkzeug-0.9.1-2.el7.noarch @extras Dep-Install python2-designateclient-2.9.0-1.el7.noarch @centos-openstack-queens Dep-Install python2-gevent-1.1.2-2.el7.aarch64 @centos-openstack-queens Dep-Install python2-ncclient-0.4.7-5.el7.noarch @centos-openstack-queens Dep-Install python2-neutron-lib-1.13.0-1.el7.noarch @centos-openstack-queens Dep-Install python2-openvswitch-1:2.9.0-3.el7.noarch @centos-openstack-queens Dep-Install python2-os-xenapi-0.3.1-1.el7.noarch @centos-openstack-queens Dep-Install python2-ovsdbapp-0.10.3-1.el7.noarch @centos-openstack-queens Dep-Install python2-pecan-1.1.2-1.el7.noarch @centos-ceph-luminous Dep-Install python2-ryu-4.15-1.el7.noarch @centos-openstack-queens Dep-Install python2-singledispatch-3.4.0.3-4.el7.noarch @centos-ceph-luminous Dep-Install python2-tinyrpc-0.5-4.20170523git1f38ac.el7.noarch @centos-openstack-queens Dep-Install python2-weakrefmethod-1.0.2-3.el7.noarch @centos-openstack-queens Dep-Install python2-zmq-14.7.0-8.el7.aarch64 @epel Dep-Install zeromq-4.1.4-6.el7.aarch64 @epel history info [root@bogon ml2]#