https://dailystuff.nlDailystuff on the Internet - Posts tagged yum2024-03-16T09:59:04.814868+00:00ABloghttps://dailystuff.nl/blog/2019/using-yum-history-to-see-package-changes.htmlUsing YUM history to see package changes2019-02-03T00:00:00+00:00Hans Spaans<section id="using-yum-history-to-see-package-changes">
<p>When you install or update packages on your system, then changes may occur that were not expected. Recent security updates on a server and left Nagios in a failed state, but what exactly happened, and can it be traced back as <em>yum-cron</em> installs all required security updates? Luckily YUM keeps a history database of all actions and with <em>yum history</em> can you list all transactions.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>sudo<span class="w"> </span>yum<span class="w"> </span><span class="nb">history</span><span class="w"> </span>list<span class="w"> </span>all
<span class="go">Loaded plugins: fastestmirror</span>
<span class="go">ID | Login user | Date and time | Action(s) | Altered</span>
<span class="go">-------------------------------------------------------------------------------</span>
<span class="go"> 15 | root <root> | 2019-02-02 07:30 | Update | 2</span>
<span class="go"> 14 | root <root> | 2019-01-05 07:52 | Update | 50</span>
<span class="go"> 13 | System ... <sysadmin> | 2018-11-04 20:45 | I, U | 62</span>
<span class="go"> 12 | Ansible ... <ansible> | 2018-11-04 01:36 | Install | 4</span>
<span class="go"> 11 | root <root> | 2018-10-20 04:21 | Update | 2</span>
<span class="go"> 10 | root <root> | 2018-10-06 07:45 | Update | 2</span>
<span class="go"> 9 | System ... <sysadmin> | 2018-09-15 08:06 | I, U | 9</span>
<span class="go"> 8 | System ... <sysadmin> | 2018-09-12 03:19 | Install | 1</span>
<span class="go"> 7 | Ansible ... <ansible> | 2018-09-09 13:19 | Install | 1</span>
<span class="go"> 6 | Ansible ... <ansible> | 2018-09-09 13:14 | Install | 29</span>
<span class="go"> 5 | Ansible ... <ansible> | 2018-09-06 14:11 | I, U | 81</span>
<span class="go"> 4 | Ansible ... <ansible> | 2018-09-06 13:21 | Install | 1</span>
<span class="go"> 3 | Ansible ... <ansible> | 2018-09-06 13:20 | Install | 51</span>
<span class="go"> 2 | Ansible ... <ansible> | 2018-09-06 13:14 | Install | 1</span>
<span class="go"> 1 | System <unset> | 2018-09-06 03:17 | Install | 275</span>
</pre></div>
</div>
<p>As transaction 15 was the latest and only transaction before the defect occurred it is the one to look into. With yum history info the details of the transaction can be shown. It shows when and who triggered the transaction, but also with which version of RPM, YUM, and which plugins for YUM were used. Most importantly it also shows which package was updated with versions used and from which repository. This narrows the search down to the packages shown as updated and sees what they changed on the system.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>sudo<span class="w"> </span>yum<span class="w"> </span><span class="nb">history</span><span class="w"> </span>info<span class="w"> </span><span class="m">15</span>
<span class="go">Loaded plugins: fastestmirror</span>
<span class="go">Transaction ID : 15</span>
<span class="go">Begin time : Sat Feb 2 07:30:58 2019</span>
<span class="go">Begin rpmdb : 450:5f24b4b6a7aaef9f42874d6c8643385133020181</span>
<span class="go">End time : 07:31:04 2019 (6 seconds)</span>
<span class="go">End rpmdb : 450:246b0b638aa8b6b851529eb1b040714b7149d0e9</span>
<span class="go">User : root <root></span>
<span class="go">Return-Code : Success</span>
<span class="go">Transaction performed with:</span>
<span class="go"> Installed rpm-4.11.3-32.el7.x86_64 @anaconda</span>
<span class="go"> Installed yum-3.4.3-158.el7.centos.noarch @anaconda</span>
<span class="go"> Installed yum-plugin-fastestmirror-1.1.31-46.el7_5.noarch @updates</span>
<span class="go">Packages Altered:</span>
<span class="go"> Updated nagios-4.3.4-5.el7.x86_64 @epel</span>
<span class="go"> Update 4.4.3-1.el7.x86_64 @epel</span>
<span class="go"> Updated nagios-common-4.3.4-5.el7.x86_64 @epel</span>
<span class="go"> Update 4.4.3-1.el7.x86_64 @epel</span>
</pre></div>
</div>
<p>Red Hat Linux 8 will be using <em>dnf</em> instead of <em>yum</em> like Fedora 18 and later, but you don’t have to relearning anything as you can use <em>dnf</em> in the same way as <em>yum</em> and with the same parameters for now.</p>
</section>
When you install or update packages on your system, then changes may occur that were not expected. Recent security updates on a server and left Nagios in a failed state, but what exactly happened, and can it be traced back as yum-cron installs all required security updates? Luckily YUM keeps a history database of all actions and with yum history can you list all transactions.As transaction 15 was the latest and only transaction before the defect occurred it is the one to look into. With yum history info the details of the transaction can be shown. It shows when and who triggered the transaction, but also with which version of RPM, YUM, and which plugins for YUM were used. Most importantly it also shows which package was updated with versions used and from which repository. This narrows the search down to the packages shown as updated and sees what they changed on the system.2019-02-03T00:00:00+00:00