Harry Putnam wrote:
> Gilbert Sullivan writes:
> > Harry Putnam wrote:
> >> Is there a command similar to `dpkg --get-selections' that shows all
> >> installed/deinstalled pkgs, but where one can get the dates of install
> >> or remove.
> >>
> >> A fairly quick pass thru man dpkg seems to indicate there is not.

I am not aware of any place that those timestamps are kept other than
in the /var/log/dpkg.log file.  You could trace through the dpkg.log
file and recreate every event that happened.  I am not aware of any
standard tools to do this for that file.

> I'm guessing by now you have worked out a script or the like to do
> automate some of that.

Standard on Debian systems is /var/backups/dpkg.status.* where current
and past versions of the package status file is saved for reference.
Using that file it is possible to tell what changed on your system
between the current system and any of those snapshots.

You can get a list of installed packages with:

  $ grep-status -s Package -n "install ok installed"
  ...dumps the current list of packages installed now...

You can get a list of packages installed at any of those snapshot
files with:

  $ grep-dctrl -s Package -n "install ok installed" /var/backups/dpkg.status.0
  ...dumps a list of previously installed packages...

Putting that information to use you can see what was different between
the backup file and now.

  $ grep-dctrl -s Package -n "install ok installed" /var/backups/dpkg.status.0 
| sort > /tmp/list.prev

  $ grep-status -s Package -n "install ok installed" | sort > /tmp/list.now

  $ comm -3 /tmp/list.prev /tmp/list.now

That will show what is different between then and now.

You can also apply similar recipies to determine what changed between
any two snapshots in the /var/backups directory.

> I can look and figure some basic helper script once I've digested the
> format of the various sources ... but hoping to coattail on something
> you've already spent some time on.

Is the above suggestion useful for this purpose?

If you need dates then I know of no other way than to read through
/var/log/dpkg.log and match up times when packages were installed from
the information logged there.

Bob

Attachment: signature.asc
Description: Digital signature

Reply via email to