Why isn’t there a historical pretty log of your upgrades, downgrades and package purges in Debian

aptitudedpkgguihistory

I wanted to lookup history of my recent updates/upgrades, package purges and found out that other than aptitude and ugly dpkg.log, there doesn't seem to be anything else which does the same. See section 9.4 of the Debian FAQ. Does anybody have an idea why such a tool which will keep a pretty log or logs of all past package administration tasks done doesn't exist. There are a few workarounds shared in the link above but no proper tool as such.

I looked up at /var/log/aptitude and the various gunzipped logs, as well as the various dpkg logs but neither of them are aimed at end-users.

    [/var/log] - [10058]
    [$] ls -lh aptitu*                                                                                                               
-rw-r--r-- 1 root root 117K May 23 15:49 aptitude
-rw-r--r-- 1 root root  24K May  1 00:26 aptitude.1.gz
-rw-r--r-- 1 root root  35K Apr  1 02:07 aptitude.2.gz
-rw-r--r-- 1 root root  26K Feb 28 03:13 aptitude.3.gz
-rw-r--r-- 1 root root  29K Jan 30 04:29 aptitude.4.gz
-rw-r--r-- 1 root root  27K Dec 30 15:28 aptitude.5.gz
-rw-r--r-- 1 root root  32K Dec  1 04:39 aptitude.6.gz

Now as can be seen the log stretches almost 6 months and aptitude does a brilliant job of keeping all my attempts of upgrades, downgrades, packages purges whatever but it records only the 'attempts' . Dpkg has a much better record but looks lot more worse than aptitude logs.

Would be glad if somebody can share some more insight. There should be some gtk/tk/GUI based tool for the same, maybe something which is an add-on to synaptic/software center or whatever tool the user chooses.

One excuse or possible explanation could be that the developers valued privacy but then you have logs for everything else, not just these so that doesn't make sense much to me.

The other part could only be, that either Debian or upstream didn't and doesn't care for such logs and expect their users to keep a history or rely on the aptitude kinda tool, this also doesn't cut much ice as –

aptitude show aptitude | grep Priority                                                                                         
Priority: optional

So there would be users who would not use aptitude.

Are there any FOSS Operating Systems (not limited to GNU/Linux) which have solved the aforementioned problem/issue ?

Best Answer

apt itself keeps nicer log files in /var/log/apt/history.log (and rotated variants); these track the start and end date and time of every set of apt operations (including those initiated by aptitude), the requesting user (when invoked using sudo), and the actions: installed packages, upgraded packages, removed packages, purged packages...

Here's an example:

Start-Date: 2016-05-09  23:29:03
Requested-By: steve (1000)
Install: libnspr4-dev:amd64 (2:4.12-2, automatic), liboauth-dev:amd64 (1.0.1-1), libcurl4-gnutls-dev:amd64 (7.47.0-1, automatic), libnss3-dev:amd64 (2:3.23-2, automatic)
End-Date: 2016-05-09  23:29:10

This shows that I requested an installation of liboauth-dev, which pulled in libnspr4-dev, libcurl4-gnutls-dev and libnss3-dev automatically.

You'll also find /var/log/apt/term.log which logs the terminal output of apt operations.

Those files don't track dpkg operations, so to get a complete picture — i.e., including operations done using dpkg directly — you'll still need to look at /var/log/dpkg.log. If you limit your direct use of dpkg as much as possible then the apt history will give a good idea of what was done when...

Related Question