When did I last run "dnf upgrade"?

Version info: Fedora 34 (Workstation Edition)

Is there a way I could determine when was the last time I ran sudo dnf upgrade in my PC ?

dnf history

To reverse the listing:

dnf history --reverse
4 Likes

Thank You ersen.
Below is the last 21 lines of “dnf history --reverse” output. I hope it will be readable after the formatting.
So, the last time I ran “dnf upgrade” was on 11-July-2021 (ID 151), for which the ‘Action’ column says ‘Upgrade’. Am I right ?

Prior to the above upgrade, I ran a “dnf upgrade” on 21-June-2021 (ID 145) for which the ‘Action’ colun says “?, E, I, O, U”. Don’t know what this means. But, will google it.

   132 | install glances                                                                                         | 2021-05-11 15:34 | Install        |    2   
   133 |                                                                                                         | 2021-05-17 19:11 | Install        |    3   
   134 | upgrade                                                                                                 | 2021-05-19 07:33 | E, I, U        |  247 EE
   135 | -y install --disablerepo=* /tmp/akmods.3NYxgBwV/results/kmod-nvidia-5.11.20-300.fc34.x86_64-465.27-1.fc | 2021-05-19 20:38 | Install        |    1   
   136 | install mediawriter                                                                                     | 2021-05-22 15:04 | Install        |    1   
   137 | install gnome-extensions-app                                                                            | 2021-05-29 15:27 | Install        |    1   
   138 | upgrade                                                                                                 | 2021-06-03 23:53 | ?, E, I, U     |  466 EE
   139 | -y install --disablerepo=* /tmp/akmods.4tNrrO67/results/kmod-nvidia-5.12.8-300.fc34.x86_64-465.31-1.fc3 | 2021-06-03 23:57 | Install        |    1   
   140 | -y install --disablerepo=* /tmp/akmods.ayoK14cA/results/kmod-nvidia-5.11.20-300.fc34.x86_64-465.31-1.fc | 2021-06-03 23:58 | Upgrade        |    1   
   141 | install chromium                                                                                        | 2021-06-05 17:13 | Install        |    3   
   142 | upgrade                                                                                                 | 2021-06-10 18:16 | ?, E, I, U     |  141 EE
   143 | -y install --disablerepo=* /tmp/akmods.ZteJb4rd/results/kmod-nvidia-5.12.9-300.fc34.x86_64-465.31-1.fc3 | 2021-06-10 18:19 | Install        |    1   
   144 | install cowsay                                                                                          | 2021-06-17 21:39 | Install        |    1   
   145 | upgrade                                                                                                 | 2021-06-21 19:45 | ?, E, I, O, U  |  366 EE
   146 | -y install --disablerepo=* /tmp/akmods.wlanMxvU/results/kmod-nvidia-5.12.11-300.fc34.x86_64-465.31-1.fc | 2021-06-21 19:49 | Install        |    1   
   147 |                                                                                                         | 2021-06-24 00:37 | Upgrade        |  101   
   148 | install eid-archive-fedora-2016-2.noarch.rpm                                                            | 2021-07-01 20:35 | Install        |    1   
   149 |                                                                                                         | 2021-07-08 11:41 | E, I, U        |  255   
   150 | -y install --disablerepo=* /tmp/akmods.2RsAUGP0/results/kmod-nvidia-5.12.14-300.fc34.x86_64-465.31-1.fc | 2021-07-08 12:32 | Install        |    1   
   151 | upgrade                                                                                                 | 2021-07-11 21:23 | Upgrade        |   51   
   152 |                                                                                                         | 2021-07-23 09:21 | E, I, U        |  203   
   153 | -y install --disablerepo=* /tmp/akmods.A7aLpoGg/results/kmod-nvidia-5.13.4-200.fc34.x86_64-465.31-1.fc3 | 2021-07-23 20:08 | Install        |    1
1 Like

here is the meaning of this file, Table 6.1. Possible values of the Action(s) field

https://docs.fedoraproject.org/en-US/Fedora/24/html/System_Administrators_Guide/sec-DNF-Transaction_History.html

Table 6.1. Possible values of the Action(s) field
Action Abbreviation Description
Downgrade D At least one package has been downgraded to an older version.
Erase E At least one package has been removed.
Install I At least one new package has been installed.
Obsoleting O At least one package has been marked as obsolete.
Reinstall R At least one package has been reinstalled.
Update U At least one package has been updated to a newer version.

Regards., HTH

4 Likes
$ dnf history | grep upgrade
   752 | -y upgrade                | 2021-07-22 23:27 | Upgrade        |   23
   751 | -y upgrade                | 2021-07-22 04:19 | I, U           |   15
   746 | -y upgrade                | 2021-07-16 02:40 | Upgrade        |    4 EE
   743 | -y upgrade                | 2021-07-14 00:42 | Upgrade        |   20
   742 | -y upgrade                | 2021-07-13 04:14 | Upgrade        |    2
   732 | -y upgrade                | 2021-07-03 00:39 | Upgrade        |    3 EE
   730 | -y upgrade                | 2021-07-01 04:16 | Upgrade        |   29
   727 | -y upgrade                | 2021-06-29 04:16 | Upgrade        |   39
   725 | -y upgrade                | 2021-06-27 04:18 | Upgrade        |    2
   722 | -y upgrade                | 2021-06-24 23:17 | I, U           |    7
   717 | -y upgrade                | 2021-06-19 04:18 | I, U           |   54
   716 | -y upgrade                | 2021-06-18 04:20 | Upgrade        |   26
   714 | -y upgrade                | 2021-06-17 02:46 | I, U           |   11 EE
   710 | -y upgrade                | 2021-06-15 04:15 | I, U           |   31
   708 | -y upgrade                | 2021-06-13 04:12 | Upgrade        |   10
   707 | -y upgrade                | 2021-06-12 02:31 | Upgrade        |    3
   704 | -y upgrade                | 2021-06-09 03:34 | Upgrade        |    7
   701 | -y upgrade                | 2021-06-07 04:20 | Upgrade        |    3 EE
   697 | -y upgrade                | 2021-06-02 04:13 | Upgrade        |    8
   695 | -y upgrade                | 2021-06-01 04:17 | I, U           |    7
   684 | -y upgrade                | 2021-05-24 04:21 | Upgrade        |   11
   682 | -y upgrade                | 2021-05-23 04:17 | I, U           |   23
   681 | -y upgrade                | 2021-05-22 04:19 | Upgrade        |   27
   680 | -y upgrade                | 2021-05-21 04:19 | Upgrade        |    6
   678 | -y upgrade                | 2021-05-20 04:12 | I, U           |    5
   677 | -y upgrade                | 2021-05-19 04:17 | Upgrade        |    4 EE
   674 | -y upgrade                | 2021-05-16 04:19 | I, U           |   24
   661 | system-upgrade upgrade    | 2021-05-07 01:55 | D, I, O, U     |  982 EE

If you only want to know the last time you used upgrade, then use head to filter the results further.

$ dnf history | grep upgrade | head -n 1
   752 | -y upgrade                | 2021-07-22 23:27 | Upgrade        |   23

And you can find details of the record using history again.

$ dnf history info 752
Transaction ID : 752
Begin time     : Thu 22 Jul 2021 11:27:10 PM EDT
Begin rpmdb    : 974:fee323d074e7b4896d76ba4b53d133ddf4a4cf89
End time       : Thu 22 Jul 2021 11:27:18 PM EDT (8 seconds)
End rpmdb      : 974:68339192b68a13737b729d6f1231f8bd82ffaf53
User           : System <unset>
Return-Code    : Success
Releasever     : 34
Command Line   : -y upgrade
Comment        :
Packages Altered:
    Upgrade  audit-3.0.3-1.fc34.x86_64            @updates
    Upgraded audit-3.0.2-1.fc34.x86_64            @@System
    Upgrade  audit-libs-3.0.3-1.fc34.x86_64       @updates
    Upgraded audit-libs-3.0.2-1.fc34.x86_64       @@System
    Upgrade  curl-7.76.1-7.fc34.x86_64            @updates
    Upgraded curl-7.76.1-4.fc34.x86_64            @@System
    Upgrade  libcurl-7.76.1-7.fc34.x86_64         @updates
    Upgraded libcurl-7.76.1-4.fc34.x86_64         @@System
    Upgrade  libipa_hbac-2.5.2-1.fc34.x86_64      @updates
    Upgraded libipa_hbac-2.5.1-2.fc34.x86_64      @@System
    Upgrade  libsss_autofs-2.5.2-1.fc34.x86_64    @updates
    Upgraded libsss_autofs-2.5.1-2.fc34.x86_64    @@System
    Upgrade  libsss_certmap-2.5.2-1.fc34.x86_64   @updates
    Upgraded libsss_certmap-2.5.1-2.fc34.x86_64   @@System
    Upgrade  libsss_idmap-2.5.2-1.fc34.x86_64     @updates
    Upgraded libsss_idmap-2.5.1-2.fc34.x86_64     @@System
    Upgrade  libsss_nss_idmap-2.5.2-1.fc34.x86_64 @updates
    Upgraded libsss_nss_idmap-2.5.1-2.fc34.x86_64 @@System
    Upgrade  libsss_sudo-2.5.2-1.fc34.x86_64      @updates
    Upgraded libsss_sudo-2.5.1-2.fc34.x86_64      @@System
    Upgrade  python3-audit-3.0.3-1.fc34.x86_64    @updates
    Upgraded python3-audit-3.0.2-1.fc34.x86_64    @@System
    Upgrade  sssd-2.5.2-1.fc34.x86_64             @updates
    Upgraded sssd-2.5.1-2.fc34.x86_64             @@System
    Upgrade  sssd-ad-2.5.2-1.fc34.x86_64          @updates
    Upgraded sssd-ad-2.5.1-2.fc34.x86_64          @@System
    Upgrade  sssd-client-2.5.2-1.fc34.x86_64      @updates
    Upgraded sssd-client-2.5.1-2.fc34.x86_64      @@System
    Upgrade  sssd-common-2.5.2-1.fc34.x86_64      @updates
    Upgraded sssd-common-2.5.1-2.fc34.x86_64      @@System
    Upgrade  sssd-common-pac-2.5.2-1.fc34.x86_64  @updates
    Upgraded sssd-common-pac-2.5.1-2.fc34.x86_64  @@System
    Upgrade  sssd-ipa-2.5.2-1.fc34.x86_64         @updates
    Upgraded sssd-ipa-2.5.1-2.fc34.x86_64         @@System
    Upgrade  sssd-kcm-2.5.2-1.fc34.x86_64         @updates
    Upgraded sssd-kcm-2.5.1-2.fc34.x86_64         @@System
    Upgrade  sssd-krb5-2.5.2-1.fc34.x86_64        @updates
    Upgraded sssd-krb5-2.5.1-2.fc34.x86_64        @@System
    Upgrade  sssd-krb5-common-2.5.2-1.fc34.x86_64 @updates
    Upgraded sssd-krb5-common-2.5.1-2.fc34.x86_64 @@System
    Upgrade  sssd-ldap-2.5.2-1.fc34.x86_64        @updates
    Upgraded sssd-ldap-2.5.1-2.fc34.x86_64        @@System
    Upgrade  sssd-nfs-idmap-2.5.2-1.fc34.x86_64   @updates
    Upgraded sssd-nfs-idmap-2.5.1-2.fc34.x86_64   @@System
    Upgrade  sssd-proxy-2.5.2-1.fc34.x86_64       @updates
    Upgraded sssd-proxy-2.5.1-2.fc34.x86_64       @@System
2 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.