date of package installation
On Wed, 19 Mar 1997, Ioannis Tambouras wrote:
> > Now this IS the answer. I just downgraded one of my systems to
> > sysvinit 2.69-1, rebooted, and the corruption seems to be gone.
>
> Few weeks ago, my corruption occured with sysvinit-2.69-1. I have been
> having this same package since December 8. For some unknown reason,
> few weeks ago my wtmp _stoped_ getting corrupted.
i haven't had any wtmp corruption problems since downgrading to 2.69-1.
those systems which i haven't downgraded and rebooted yet are still
getting corruption, those which i have aren't getting any.
> And I have one dpkg request: An option that tells which packages were
> intalled since a certain date, i.g., % dpkg -older 2/28/97 .
it's not a feature (documented or otherwise) of dpkg but i've found
that you can do an 'ls -alrt /var/lib/dpkg/info/*.list' to get a rough
listing of what days packages were upgraded.
(note, this is the date the package was actually installed/upgraded on
the target system, *NOT* the date that the package was released)
on my system, for example:
-rw-r--r-- 1 root root 85 Nov 17 1995 untex.list
-rw-r--r-- 1 root root 139 Apr 16 1996 giftrans.list
-rw-r--r-- 1 root root 0 Apr 17 1996 libc.list
[...many lines deleted...]
-rw-r--r-- 1 root root 1706 Mar 15 13:39 tetex-bin.list
-rw-r--r-- 1 root root 153 Mar 15 13:40 pico.list
-rw-r--r-- 1 root root 399 Mar 15 13:40 pine.list
it shouldn't be too difficult to use write a script using find to build
a list of packages modified less than x days old.
something like:
#! /bin/sh
# dpkg_age: list packages installed on system before/since
# $1 days.
#
# $1 = days. This is the find mtime argument so can be +, -,
# or unsigned. see find(1) for details.
#
# BUGS: dpkg_age is a really crappy name but it's the only thing i
# could think of at the time :-)
find /var/lib/dpkg/info -mtime $1 -name "*.list" -not -empty \ -exec
basename \{\} .list \;
the "-not -empty" excludes empty .list files...i.e. "purged" packages.
"removed" packages with conf files will still show up in the list
because the .list file will not be empty.
e.g. to display all installed packages on the system which haven't been
updated for 320 days or more:
$ dpkg_age +320
rc
knews
cached
[...several lines deleted...]
xloadimage
xcal
xkeycaps
example 2: to display all packages which have been installed or upgraded in
the last 6 days.
$ dpkg_age -6
file
pine
samba
[...several lines deleted...]
libpwdb0
libpam-util
libpam0
variations on this theme will probably give you what you want. enjoy.
craig
ps: this really is undocumented dpkg behaviour. don't count on it. it
may change. it may not work. if it breaks you own both pieces plus the
disclaimer "what do you expect when you go making assumptions about the
files under /var/lib/dpkg"
Reply to: