Bug 1476926 - produce equivalent to yum.log (log of package installs, updates, and removes)
produce equivalent to yum.log (log of package installs, updates, and removes)
Status: NEW
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
26
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: rpm-software-management
Fedora Extras Quality Assurance
: Reopened, Triaged
Depends On: 1355764
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-31 16:30 EDT by plaffiazho
Modified: 2017-11-20 06:42 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-09-27 07:51:55 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description plaffiazho 2017-07-31 16:30:11 EDT
yum produced a nice neat log file which simply listed the dates and times for each package added, updated, and removed. This is extremely helpful for many purposes, such as:

1) tracking down which update caused a problem (useful in case it's necessary to revert to the older version, as well as for quality of bug reports to upstream)
2) tracking down how packages added/removed correlate with e.g. system performance or other issues
3) undoing a transaction (e.g. knowing all packages and dependencies which were installed if it's decided you don't want the software after all, or vis versa (think remove-with-leaves))
4) after-the-fact documentation of what software was manually added to an installation, which may need to be reproduced when migrating to another machine

An example of each type of entry in yum.log:

Apr 06 03:19:09 Updated: yum-3.2.29-81.el6.centos.noarch
May 25 20:10:54 Erased: postfix
Jul 12 05:59:27 Installed: kernel-2.6.32-696.3.2.el6.x86_64

Could this please be added to dnf?
Comment 1 Daniel Mach 2017-09-27 07:51:55 EDT
I suppose your request was to add this functionality to DNF (reassigning the component from libdnf to dnf).
The feature exists already - there's dnf.log and also dnf history command.
Comment 2 plaffiazho 2017-09-28 15:23:28 EDT
have you looked at dnf.log? it is not analogous to yum.log ...

my current dnf.log has 12,578 lines -- mostly useless information like the following (this is only a sample):
2017-09-28T17:30:02Z INFO --- logging initialized ---
2017-09-28T17:30:02Z DDEBUG timer: config: 7 ms
2017-09-28T17:30:02Z DEBUG Loaded plugins: builddep, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, needs-restarting, playground, repoclosure, repograph, repomanage, reposync
2017-09-28T17:30:02Z DEBUG DNF version: 2.6.3
2017-09-28T17:30:02Z DDEBUG Command: dnf makecache timer 
2017-09-28T17:30:02Z DDEBUG Installroot: /
2017-09-28T17:30:02Z DDEBUG Releasever: 26
2017-09-28T17:30:02Z DEBUG cachedir: /var/cache/dnf
2017-09-28T17:30:02Z DDEBUG Base command: makecache
2017-09-28T17:30:02Z DDEBUG Extra commands: ['makecache', 'timer']
2017-09-28T17:30:02Z DEBUG Making cache files for all metadata files.
2017-09-28T17:30:02Z INFO Metadata cache refreshed recently.
2017-09-28T17:30:02Z DDEBUG Cleaning up.

But even if it didn't have all the useless information to dig through, it only contains information going back 4 days!

executing "dnf history" also doesn't output a summary analogous to yum.log, but instead you get stuff like:
ID     | Command line             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
    87 |                          | 2017-09-26 22:39 | I, U           |   21   
    86 |                          | 2017-09-26 15:27 | Install        |    3   
    85 |                          | 2017-09-24 22:57 | Update         |   16   
    84 |                          | 2017-09-23 18:21 | Update         |   17

then there's dnf.rpm.log, which at least shows packages installed and removed (doesn't look like it shows packages updated?), but again it only goes back 4 days, and MOST of the entries are like follows:
2017-09-28T18:27:06Z INFO --- logging initialized ---
2017-09-28T18:30:02Z INFO --- logging initialized ---
2017-09-28T18:42:11Z INFO --- logging initialized ---
2017-09-28T18:57:28Z INFO --- logging initialized ---
2017-09-28T19:10:27Z INFO --- logging initialized ---
2017-09-28T19:12:32Z INFO --- logging initialized ---

I'm not aware of any way to get something like yum.log to meet any of it's use cases in a reasonable way. am i missing something?
Comment 3 Jaroslav Rohel 2017-10-13 01:30:14 EDT
From my point of view is dnf history command more comfortable for user than log file. 

>then there's dnf.rpm.log, which at least shows packages installed and removed (doesn't look like it shows packages updated?), but again it only goes back 4 days,

You can get list of installed/removed packages from history command too. Try to use "dnf history info <ID>" command where <ID> is id of transaction. Eg. "dnf history 85"

I don't know why your "Command line" column is blank. My example of real usage of history command:

I want view last 3 transactions
# dnf history list last..last-2
ID     | Command line             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
   619 | history undo last        | 2017-10-13 06:33 | Erase          |    2   
   618 | install -y https://kojip | 2017-10-13 06:29 | Install        |    2   
   617 | upgrade /tmp/tito/x86_64 | 2017-10-11 07:58 | Update         |    5 EE

And now I want more info about transaction 618
# dnf history info 618
Transaction ID : 618
Begin time     : Fri Oct 13 06:29:21 2017
Begin rpmdb    : 2700:aca7f0c0e95d9cabe14ed0960d122d4430dc386d
End time       : Fri Oct 13 06:29:22 2017 (1 seconds)
End rpmdb      : 2702:0e2c92db8732ca8947f1136bf354f236f76f8ea1
User           : Jaroslav Rohel <jrohel>
Return-Code    : Success
Command Line   : install -y https://kojipkgs.fedoraproject.org//packages/dbus/1.11.16/4.fc27/x86_64/dbus-debugsource-1.11.16-4.fc27.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/dbus/1.11.16/4.fc27/x86_64/dbus-debuginfo-1.11.16-4.fc27.x86_64.rpm
Transaction performed with:
    Installed     dnf-2.7.2-1.git.61.4812d55.fc26.noarch (unknown)
    Installed     rpm-4.13.0.1-7.fc26.x86_64             @updates
Packages Altered:
    Install dbus-debuginfo-1:1.11.16-4.fc27.x86_64   @@commandline
    Install dbus-debugsource-1:1.11.16-4.fc27.x86_64 @@commandline
Comment 4 plaffiazho 2017-10-14 17:52:40 EDT
> You can get list of installed/removed packages from history command too.
> Try to use "dnf history info <ID>" command where <ID> is id of transaction.
> Eg. "dnf history 85"

that requires going through one at a time ... for me currently for over 100 transactions (and this is still pretty early in the life of this install (indeed, for you it's over 600)) ... plus, it requires sifting through a lot more text to get the information I'm interested in which was presented in yum.log

> I don't know why your "Command line" column is blank.
> My example of real usage of history command:

the example I provided was also from real usage. my guess at why those transactions showed a blank command line columns is that they were transactions performed through the dnf api by yumex rather than through the dnf command line program. some of the entries show something in the command line column for me and some don't.
Comment 5 Jaroslav Rohel 2017-10-16 04:46:19 EDT
> that requires going through one at a time ... for me currently for over 100 transactions (and this is still pretty early in the life of this install (indeed, for you it's over 600)) ... plus, it requires sifting through a lot more text to get the information I'm interested in which was presented in yum.log

"for" and "grep" can help.
Example:
for i in {515..619} ; do dnf history info $i ; done | grep -E 'time|Install|Upgrade|Reinstall|Erase'

I admit it is not very user-friendly.
But I think that better solution will be to improve "history" command than changing log file.
Comment 6 Fedora End Of Life 2017-11-16 14:04:51 EST
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Comment 7 plaffiazho 2017-11-18 10:09:12 EST
Jaroslav Rohel, your suggestion also assumes the system is running, whereas the admin could very well be looking into what packages were installed on an inactive installation that exists on another partition, for example.
Comment 8 Basic Six 2017-11-20 06:42:40 EST
I also opened a bug about dnf logging useless messages (while important messages appear to be missing):
https://bugzilla.redhat.com/show_bug.cgi?id=1364029

That was over a year ago. My bug was closed as a duplicate of bug 1355764, which is just a month older. There are enough complaints and detailed comments. Sadly, nobody seems to be working on this, judging by the lack of serious responses.
Let's hope that some developers will see this bug and improve the software to provide a useful log file similar to the old yum.log.

Note You need to log in before you can comment on or make changes to this bug.