[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: is their a log of apt and/or dpkg?



On Thu, May 22, 2003 at 04:57:14PM -0500, Elizabeth Barham wrote:
> Hi,
> 
>    I was wondering if there is any kind of logging system that records
> exactly which packages *were* installed. For example, I'm not 100%
> sure of which OpenOffice we had installed on a particular machine
> before upgrading to 1.0.3 and I'd like to find out, if possible. Is
> there a log somewhere (or a way to generate a log) to produce
> something like:
> 
>     2002-12-20: Installed openoffice.org-files_1.0.2
>     2003-03-12: Upgraded apache_1.0.24 to apache_1.0.25
> 
> etc.

aptitude has a log file. apt-get and dpkg don't.

Another way: after installing or upgrading packages, run a script like:

#!/bin/bash
#
# Base on script written by Larry Holish, ljholish@speakeasy.net
# and posted to debian-users list 7 Aug 2002
#
#
# Script that writes current list of packages installed
# from /var/lib/dpkg/available to pkgs.current.
# Keeps a history of changes between package versions
# in history.txt.

LISTDIR=/home/dad/debian
cd $LISTDIR

if [ -f 'install_history.txt.gz' ]; then
	gunzip install_history.txt.gz
fi

if [ -f 'pkgs.current' ]; then
	mv pkgs.current pkgs.last
fi

COLUMNS=155 dpkg -l | grep "^i" | cut -b 5- > pkgs.current

diff -C 0 pkgs.last pkgs.current >> install_history.txt

gzip install_history.txt
rm -f pkgs.last

# EOF

-- 
Jerome

Attachment: pgp7426HGJsf2.pgp
Description: PGP signature


Reply to: