Package: pkglog
PKGLOG - Linux utility to output concise log of package changesThis is a Linux command line utility to output a concise list of
packages installed, removed, upgraded, downgraded, or reinstalled. It
should be able to parse package log formats used by the common Linux
distributions. Example output is shown below.Most terminals show this output in color, as seen above. Five
different colors are used to identify the package actions as shown
in the table below. You can choose to disable colored output.Changes are grouped together by time so you can distinguish the group
of packages changed each time you did package
updates/installs/removal. By default, all changes with less than a
succeeding 2 minute gap between any of them are grouped together, but
you can change that time value.By default, only package changes over the last 30 days are shown. You
can choose to specify the number of days back, or from a specific
date (optionally plus a time, or specify just a time and today is
assumed), since last boot, or for all time.TheLAST SYSTEM BOOTline shows you which packages have been
changed since the last boot, e.g. if the linux kernel package has
updated you may decide to reboot asap.You can specify a package name and only changes to that package are
shown. See the USAGE section below.You can use the-n/--installed-netoption to see a list of all
packages currently installed and their date of installation. E.g. use
this option after you have installed and removed a heap of trial
packages and you want to easily see if you have actually removed all
of them and their dependencies. E.g.pkglog -n -d0shows a net
summary of packages you ended up installing today. Refer to theInstalled Net Output Optionssection below.See the latest documentation and code athttps://github.com/bulletmark/pkglog.Colored Output LinesPackage ActionLine Text ColorInstalledgreenRemovedredUpgradedyellowDowngradedmagentaReinstalledcyanYou can use a command line option to disable colors explicitly, or set
that option disabled as adefault option.Log File FormatsParsers for the following log formats currently exist. The appropriate
parser for you system is normally automatically determined.
Alternatively, you can choose the log file path[s], and/or parser
explicitly. You can also set these asdefault
options.A very simple parser plugin architecture is used, so creating a new
parser is easy. Use the-f/--parser-fileoption to explicitly specify
the path to your custom parser for development. By default, parsers are
loaded from theparsers/sub-directory so, if cloning, forking, or
submitting a PR for the software, then simply place your custom parser
file in that directory and the program will automatically recognise it.
See thecurrent parsersfor example code.Log ParserDefault PathDistributionapt/var/log/apt/history*Debian, Ubuntu, etcdnf/var/log/dnf.rpm.logRedHat, Fedora, etcpacman/var/log/pacman.logArch, Manjaro, etczypper/var/log/zypp/historyOpenSUSEUsageTypepkglog -hto view the usage summary:usage: pkglog [-h] [-u | -i | -I | -n] [-N INSTALLED_NET_DAYS]
                   [-d DAYS | -a | -b] [-j] [-v] [-c]
                   [-p {pacman,zypper,apt,dnf} | -f PARSER_PLUGIN]
                   [-t TIMEGAP] [-P PATH] [-g | -r] [-V]
                   [package]

Reports concise log of package changes.

positional arguments:
  package               specific package name to report

options:
  -h, --help            show this help message and exit
  -u, --updated-only    show updated only
  -i, --installed       show installed/removed only
  -I, --installed-only  show installed only
  -n, --installed-net   show net installed only
  -N INSTALLED_NET_DAYS, --installed-net-days INSTALLED_NET_DAYS
                        days previously removed before being re-considered as
                        new net installed, default=2. Set to 0 to disable.
  -d DAYS, --days DAYS  show all packages only from given number of days ago,
                        or from given YYYY-MM-DD[?HH:MM[:SS]],
                        default=30(days), 0=today, -1=all. If only time is
                        specified, then today is assumed.
  -a, --alldays         show all packages for all days (same as "--days=-1")
  -b, --boot            show only packages updated since last boot
  -j, --nojustify       don't right justify version numbers
  -v, --verbose         be verbose, describe upgrades/downgrades
  -c, --no-color        do not color output lines
  -p {pacman,zypper,apt,dnf}, --parser {pacman,zypper,apt,dnf}
                        log parser type, default=pacman
  -f PARSER_PLUGIN, --parser-plugin PARSER_PLUGIN
                        path to alternate custom parser plugin file
  -t TIMEGAP, --timegap TIMEGAP
                        max minutes gap between grouped changes, default=2
  -P PATH, --path PATH  alternate log path[s] (separate multiple using ":",
                        must be time sequenced)
  -g, --glob            given package name is glob pattern to match
  -r, --regex           given package name is regular expression to match
  -V, --version         show pkglog version

Note you can set default starting options in ~/.config/pkglog-flags.conf.Installed Net Output OptionsThe purpose of the-n/--installed-netoption is perhaps not
intuitively clear so this section explains it by way of an example.There are times when experimenting etc that I install and remove a heap
of various packages, e.g. over a few hours or days. At the end of that
experiment I remove all the packages I believe I installed for my
experiment. However, I am never too sure I have removed everything, e.g.
some dependencies that were automatically installed. So I type:$pkglog-d4-nThe above shows the "net" packages have ended up installed over the last 4
days, i.e. those that were newly installed in the last 4 days and not
yet removed. I can then manually remove any packages I see listed that I
don't want.There are some favorite packages which I normally have always installed
but I may remove very temporarily for some reason. Since these packages
then appear "newly" installed then they may be undesirably listed in the-n/--installed-netoutput. To avoid this the-N/--installed-net-daysoption, by default set to 2 days, removes packages from the-n/--installed-netoutput which were previously uninstalled only for
that specified number of days or less. You can disable this filter
option by setting it to 0, e.g. as adefault option.Default OptionsYou can add default options to a personal configuration file~/.config/pkglog-flags.conf. If that file exists then each line of
options in the file will be concatenated and automatically prepended
to yourpkglogcommand line options.This allow you to set default preferred starting options topkglog.
Typepkglog -hto see the options supported.
E.g.echo "--days 7" >~/.config/pkglog-flags.confto makepkglogonly display the last 7 days of changes by default. This is also useful
to set your parser explicitly using-p/--parser(e.g. if the default
parser is not automatically determined correctly on your system).InstallationArch Linux users can installpkglog from the
AUR.Python 3.7 or later is required.
Notepkglog is on PyPIso just
ensure thatpipxis installed then
type the following:$ pipx install pkglogTo upgrade:$ pipx upgrade pkglogNote that python packagelooseversionis also
required if you want to parse zypper logs:$ pipx inject pkglog looseversionLicenseCopyright (C) 2020 Mark Blakeney. This program is distributed under the
terms of the GNU General Public License.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or any later
version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License athttp://www.gnu.org/licenses/for more details.