yum
保留自己的历史记录,因此您可以使用其历史记录来确定何时安装或更新软件包。
例如,yum history packages-info ruby
将为您提供所有涉及ruby的交易,其中最古老的交易通常是安装软件包的交易。
Transaction ID : 102
Begin time : Thu Apr 3 17:15:17 2014
Package : ruby-2.0.0.353-16.fc20.x86_64
State : Install
Size : 64,734
Build host : buildvm-17.phx2.fedoraproject.org
Build time : Thu Nov 28 06:01:20 2013
Packager : Fedora Project
Vendor : Fedora Project
License : (Ruby or BSD) and Public Domain
URL : http://ruby-lang.org/
Source RPM : ruby-2.0.0.353-16.fc20.src.rpm
Commit Time : Mon Nov 25 07:00:00 2013
Committer : V?t Ondruch <vondruch@redhat.com>
Reason : user
Command Line : install ruby rubygems
From repo : updates
Installed by : Michael Hampton <error>
这将为您提供事务ID,然后您可以查找它并找到已安装的依赖项,例如使用yum history info <ID>
。
Transaction ID : 102
Begin time : Thu Apr 3 17:15:17 2014
Begin rpmdb : 2336:55d492c6f5d091f328529861bdf95111264337f6
End time : 17:15:20 2014 (3 seconds)
End rpmdb : 2346:ccca040d610665c49a1ff6a11f787f8d5aa6790d
User : Michael Hampton <error>
Return-Code : Success
Command Line : install ruby rubygems
Transaction performed with:
Updated rpm-4.11.2-2.fc20.x86_64 @updates/20
2 packages excluded due to repository priority protections
Updated yum-3.4.3-137.fc20.noarch ?
Updated yum-metadata-parser-1.1.4-9.fc20.x86_64 @fedora/20
Packages Altered:
Install ruby-2.0.0.353-16.fc20.x86_64 @updates/20
Dep-Install ruby-irb-2.0.0.353-16.fc20.noarch @updates/20
Dep-Install ruby-libs-2.0.0.353-16.fc20.x86_64 @updates/20
Dep-Install rubygem-bigdecimal-1.2.0-16.fc20.x86_64 @updates/20
Dep-Install rubygem-io-console-0.4.2-16.fc20.x86_64 @updates/20
Dep-Install rubygem-json-1.7.7-101.fc20.x86_64 @fedora/20
Dep-Install rubygem-psych-2.0.0-16.fc20.x86_64 @updates/20
Dep-Install rubygem-rdoc-4.0.1-2.fc20.noarch @fedora/20
Install rubygems-2.1.11-115.fc20.noarch @updates/20
Dep-Install rubypick-1.1.1-1.fc20.noarch @updates/20
如果该软件包是刚刚安装的,但尚未更新,则可以使用来回滚事务yum history undo 102
。如果自安装以来已更新了任何软件包,则该方法将不起作用,因为它与名称,版本和发行版相匹配。
而且,如果您确实只是安装了软件包,则可以跳过所有其他内容并运行yum history undo last
以回滚最近的事务。