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

Re: how to keep packages in synch across the lab?



On Fri, 26 Apr 2002 15:45:33 -0400, Steve M. Robbins wrote:

>I have a problem that has been vexing me for some months now ...
>
>I administer a smallish lab of machines all running debian.  I'd like
>to know how others handle the chore of keeping the same revision of
>packages installed on each machine.
>
>I'm using one machine as the "master installer" --- I use it to run
>dselect/apt and choose the packages to install.  Then I'd like the
>packages to magically appear on the other machines.  [Well, unless
>it is an older machine with less disk space...]
>
>Even a partial solution would be useful: is there a tool that will
>mail me a summary each week that lists the package changes that
>I made to the master install machine -- the packages upgraded, removed,
>or installed.

Here is a script I stole from Larry Holish, (ljholish<at>speakeasy.net)
a couple of months ago.  Except for the mail thing, it seems to do
exactly what you want.  I don't see any problem with having a cron job
run this weekly, with output mailed to you rather than (or in addition
to) concatting to file.  It tracks all changes that are done via
apt-get, dselect, or dpkg.  Locally written scripts, tar pkgs, & etc.
are not tracked.
--
gt
It is interesting to note that as one evil empire (generic) fell,
another Evil Empire (tm)  began its nefarious rise. -- me
Coincidence?  I think not.
#!/bin/sh

# Here is a simple shell script I run after each apt or dselect run that
# may be helpful.  It basically keeps a text file of what package's are
# currently installed (dpkg -L), which I find faster to grep through when
# I'm looking for something anyway (than using dpkg -S).
#
# The next time the script is run, it uses diff to find the differences
# between the current and last runs, and appends it to a 'history' file.
# So for each date/time apt is run, you can see what packages were added,
# removed or upgraded (along with their versions/descriptions).

# Written by Larry Holish, ljholish@speakeasy.net


# Script that writes current list of packages installed
# from /var/lib/dpkg/available to pkgs_woody.current.
# Keeps a history of changes between package versions
# in woody_history.txt.

LISTDIR=/home/gt/debian
cd $LISTDIR

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

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

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

diff -C 0 pkgs_woody.last pkgs_woody.current >> woody_history.txt

gzip woody_history.txt
rm -f pkgs_woody.last

# EOF

Reply to: