Re: how to tell what packages are unused on a debian server?

2010-10-30 Thread Andrei Popescu
On Sb, 30 oct 10, 14:05:37, Andrew McGlashan wrote:
 
 [I created my own aptitude front-end which has logging]

How is this different from /var/log/aptitude ?

Regards,
Andrei
-- 
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic


signature.asc
Description: Digital signature


Re: how to tell what packages are unused on a debian server?

2010-10-30 Thread Chris Davies
Andrew McGlashan andrew.mcglas...@affinityvision.com.au wrote:
 Okay, I tried the change and let it finish the report.

 I found all in use, except for php5, but there is a bunch of php5 
 stuff that is in use.

Arrgghh. You're now making me /think/ about the script, rather than it
being a throwaway suggestion(!) Upon further investigation, the atime
for a symbolic link is (inevitably) updated when it's deferenced, so
you need to skip those, too.

The find statement thus becomes
find $(readlink -f $F) -atime -180

On my laptop it's tricky for me to test this as I mount everything
noatime. On a couple of servers I've got, though, the results feel
approximately correct.

If you're finding that everything is in use then at this stage it's
probable that you've made a filesystem backup with tar or cpio, which
obviously reads every single file, unfortunately making atime useless.

Good luck!
Chris


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/48vsp7xnra@news.roaima.co.uk



Re: how to tell what packages are unused on a debian server?

2010-10-30 Thread Andrew McGlashan

Andrei Popescu wrote:

On Sb, 30 oct 10, 14:05:37, Andrew McGlashan wrote:

[I created my own aptitude front-end which has logging]


How is this different from /var/log/aptitude ?


Okay, I didn't know that was there, but the logging I do is different.

Thanks

--
Kind Regards
AndrewM

Andrew McGlashan
Broadband Solutions now including VoIP


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ccbda7a.5000...@affinityvision.com.au



Re: how to tell what packages are unused on a debian server?

2010-10-30 Thread Andrew McGlashan

Chris Davies wrote:

The find statement thus becomes
find $(readlink -f $F) -atime -180


Okay, I got the exact same result.


If you're finding that everything is in use then at this stage it's
probable that you've made a filesystem backup with tar or cpio, which
obviously reads every single file, unfortunately making atime useless.


I use dump and restore test (I know some files will change and be 
inconsistent, but that is okay).  I plan to use lvm snapshots soon to 
make sure everything is 100% consistent.


Don't use tar or cpio for backups.

I also use rsync for backups to other areas and remotely, so that might 
update atimes?  I don't think it should.


--
Kind Regards
AndrewM

Andrew McGlashan
Broadband Solutions now including VoIP


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ccbddf3.5060...@affinityvision.com.au



Re: how to tell what packages are unused on a debian server?

2010-10-30 Thread Andrei Popescu
On Sb, 30 oct 10, 19:42:34, Andrew McGlashan wrote:
 Andrei Popescu wrote:
 On Sb, 30 oct 10, 14:05:37, Andrew McGlashan wrote:
 [I created my own aptitude front-end which has logging]
 
 How is this different from /var/log/aptitude ?
 
 Okay, I didn't know that was there, but the logging I do is different.

Would you mind going into details? Are you aware of /var/log/dpkg.log 
too? How about sending a patch to aptitude?

Regards,
Andrei
P.S. No need to CC me, I am subscribed
-- 
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic


signature.asc
Description: Digital signature


Re: how to tell what packages are unused on a debian server?

2010-10-30 Thread Andrew McGlashan

Hi Andrei,

Andrei Popescu wrote:

On Sb, 30 oct 10, 19:42:34, Andrew McGlashan wrote:

Andrei Popescu wrote:

On Sb, 30 oct 10, 14:05:37, Andrew McGlashan wrote:

[I created my own aptitude front-end which has logging]

How is this different from /var/log/aptitude ?

Okay, I didn't know that was there, but the logging I do is different.


Would you mind going into details? Are you aware of /var/log/dpkg.log 
too? How about sending a patch to aptitude?


In a nutshell, I capture all the standard output from an install in one 
file, together with a show of the package [as it was at install time] 
-- not sure I'll ever need to refer back to this.


The other things I do are to keep a simple history of all aptitude use 
by logging the parameters used for each invocation.


If packages are removed or installed, I create a new set of files that 
describes the installed packages -- this is so that I can track changes 
over time.


All the extra stuff that I do is there to help documents somewhat 
changes to the system.


At the end of the day, the standard /var/log/dpkg.log and 
/var/log/aptitude will probably give enough info for most people -- so I 
can't see any benefit in patching something that isn't broken, it is 
only different to the logging that I create for myself.  My simple 
script is there for anyone who wants it -- it is pretty basic, but 
effective for my needs.


I guess my main objective is to provide an historical picture of what 
was installed when and such information might be useful for machine 
rebuilds or as a reference for a completely new build on another machine.


--
Kind Regards
AndrewM

Andrew McGlashan
Broadband Solutions now including VoIP


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ccc0c5d.6070...@affinityvision.com.au



how to tell what packages are unused on a debian server?

2010-10-29 Thread Robert P. J. Day

  just a cleanup-related question but on a debian lenny server that
i've inherited, i'm curious to know which packages have no value
whatever and that i can delete.  i recall there's a utility that will
identify unused libraries but i'm curious about what else i can
pinpoint that can be removed.

  this system is a web/mail server and, since its IP address is
assigned statically and another system is responsible for all DNS/DHCP
functionality internally, i conclude that i can remove the
dhcp-related packages.  that's just one example.

  any utilities that can help out in this regard?  thanks.

rday

-- 


Robert P. J. Day   Waterloo, Ontario, CANADA
http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/alpine.deb.2.00.1010290608040.4...@localhost6.localdomain6



Re: how to tell what packages are unused on a debian server?

2010-10-29 Thread Kousik Maiti
You can you deborphan. You can get the unnecessary packages.


On Fri, Oct 29, 2010 at 3:42 PM, Robert P. J. Day rpj...@crashcourse.cawrote:


  just a cleanup-related question but on a debian lenny server that
 i've inherited, i'm curious to know which packages have no value
 whatever and that i can delete.  i recall there's a utility that will
 identify unused libraries but i'm curious about what else i can
 pinpoint that can be removed.

  this system is a web/mail server and, since its IP address is
 assigned statically and another system is responsible for all DNS/DHCP
 functionality internally, i conclude that i can remove the
 dhcp-related packages.  that's just one example.

  any utilities that can help out in this regard?  thanks.

 rday

 --

 
 Robert P. J. Day   Waterloo, Ontario, CANADA
http://crashcourse.ca

 Twitter:   http://twitter.com/rpjday
 LinkedIn:   http://ca.linkedin.com/in/rpjday
 


 --
 To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
 with a subject of unsubscribe. Trouble? Contact
 listmas...@lists.debian.org
 Archive:
 http://lists.debian.org/alpine.deb.2.00.1010290608040.4...@localhost6.localdomain6




-- 
Wishing you the very best of everything, always!!!
Kousik Maiti(কৌশিক মাইতি)
Registered Linux User #474025
Registered Ubuntu User # 28654


Re: how to tell what packages are unused on a debian server?

2010-10-29 Thread Camaleón
On Fri, 29 Oct 2010 06:12:55 -0400, Robert P. J. Day wrote:

 just a cleanup-related question but on a debian lenny server that i've
 inherited, i'm curious to know which packages have no value whatever and
 that i can delete.  i recall there's a utility that will identify unused
 libraries but i'm curious about what else i can pinpoint that can be
 removed.
 
   this system is a web/mail server and, since its IP address is
 assigned statically and another system is responsible for all DNS/DHCP
 functionality internally, i conclude that i can remove the dhcp-related
 packages.  that's just one example.

Not that fast :-)

You may have installed packages that are unused but needed as a 
dependency requirement of another packages that you want to keep.

If you are not facing space problems, I won't touch anything. What you 
could do instead is disabling services you are not using at all, that's  
what I use to do.

Greetings,

-- 
Camaleón


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/pan.2010.10.29.11.14...@gmail.com



Re: how to tell what packages are unused on a debian server?

2010-10-29 Thread Robert P. J. Day
On Fri, 29 Oct 2010, Camaleón wrote:

 On Fri, 29 Oct 2010 06:12:55 -0400, Robert P. J. Day wrote:

  just a cleanup-related question but on a debian lenny server that
  i've inherited, i'm curious to know which packages have no value
  whatever and that i can delete.  i recall there's a utility that
  will identify unused libraries but i'm curious about what else i
  can pinpoint that can be removed.
 
this system is a web/mail server and, since its IP address is
  assigned statically and another system is responsible for all
  DNS/DHCP functionality internally, i conclude that i can remove
  the dhcp-related packages.  that's just one example.

 Not that fast :-)

  screech!!! :-)

 You may have installed packages that are unused but needed as a
 dependency requirement of another packages that you want to keep.

  of course, but any attempt to remove that package would immediately
tell me about the dependency so that's not something that concerns me.

 If you are not facing space problems, I won't touch anything. What
 you could do instead is disabling services you are not using at all,
 that's what I use to do.

  oh, i understand all that and i'm working on that.  and i never
assumed this would be an easy thing to do.  as one other poster
suggested, i can start with deborphan and see where that takes me.
and over the next little while, i plan on manually checking the
installed packages and determining whether they have any value.

  i was just wondering if there was any cool utility that would scan a
system and based on god-knows-what, simply *suggest* packages that are
apparently unused.

  for instance, if a given shared library hasn't been linked in weeks
or months, that's something to look at.  if none of the binary
executables in a package have been executed in that long, another
package to examine, that sort of thing.

  anyway, i was just curious to see how easy it was to do something
like that.  thanks.

rday

-- 


Robert P. J. Day   Waterloo, Ontario, CANADA
http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday


Re: how to tell what packages are unused on a debian server?

2010-10-29 Thread Joao Ferreira gmail
On Fri, 2010-10-29 at 06:12 -0400, Robert P. J. Day wrote:
 just a cleanup-related question but on a debian lenny server that
 i've inherited, i'm curious to know which packages have no value
 whatever and that i can delete.  i recall there's a utility that will
 identify unused libraries but i'm curious about what else i can
 pinpoint that can be removed.

apt-get autoremove

will help you remove packages that are not needed by other packages !

 
   this system is a web/mail server and, since its IP address is
 assigned statically and another system is responsible for all DNS/DHCP
 functionality internally, i conclude that i can remove the
 dhcp-related packages.  that's just one example.

this is a bit more human dependent ... the packaging system can not
tell what packages _you_ don't want...

I'dd suggest dpkg -l and start looking at the one-by-one trying to
identify things you don't want.

then apt-get remove package-i-dont-want ... but be carefull with the
things that will be cascade-removed !!! read the messages carefully
before saying the final Yes :)

cheers
j


 
   any utilities that can help out in this regard?  thanks.
 
 rday
 
 -- 
 
 
 Robert P. J. Day   Waterloo, Ontario, CANADA
 http://crashcourse.ca
 
 Twitter:   http://twitter.com/rpjday
 LinkedIn:   http://ca.linkedin.com/in/rpjday
 
 
 



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1288351191.2397.7.ca...@squeeje.critical.pt



Re: how to tell what packages are unused on a debian server?

2010-10-29 Thread Andrew McGlashan

Hi Robert,

Robert P. J. Day wrote:

  just a cleanup-related question but on a debian lenny server that
i've inherited, i'm curious to know which packages have no value
whatever and that i can delete.  i recall there's a utility that will
identify unused libraries but i'm curious about what else i can
pinpoint that can be removed.

  this system is a web/mail server and, since its IP address is
assigned statically and another system is responsible for all DNS/DHCP
functionality internally, i conclude that i can remove the
dhcp-related packages.  that's just one example.

  any utilities that can help out in this regard?  thanks.


A Debian package called deborphan might be useful.

When you remove items, you may want to purge them to be cleaner.

Also, if you are not sure why a package is installed, you can do an 
aptitude why packagename and it will (hopefully) give you the extra 
information you need.


Cheers

--
Kind Regards
AndrewM

Andrew McGlashan
Broadband Solutions now including VoIP

Current Land Line No: 03 9912 0504
Mobile: 04 2574 1827 Fax: 03 9012 2178

National No: 1300 85 3804

Affinity Vision Australia Pty Ltd
http://www.affinityvision.com.au
http://adsl2choice.net.au

In Case of Emergency --  http://www.affinityvision.com.au/ice.html


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ccab78e.7040...@affinityvision.com.au



Re: how to tell what packages are unused on a debian server?

2010-10-29 Thread Wolodja Wentland
On Fri, Oct 29, 2010 at 23:01 +1100, Andrew McGlashan wrote:
 Robert P. J. Day wrote:
   just a cleanup-related question but on a debian lenny server that
 i've inherited, i'm curious to know which packages have no value
 whatever and that i can delete.  i recall there's a utility that will
 identify unused libraries but i'm curious about what else i can
 pinpoint that can be removed.

 When you remove items, you may want to purge them to be cleaner.

In addition to purging installed packages I would also suggest to purge
already removed packages:

aptitude purge ~c

will take care of that.

Another good way to find unused packages is 'popcon-largest-unused' from
the popularity-contest package.

/me is removing some packages now :)
-- 
  .''`. Wolodja Wentlandwolodja.wentl...@ed.ac.uk 
 : :'  :
 `. `'` 4096R/CAF14EFC 
   `-   081C B7CD FF04 2BA9 94EA  36B2 8B7F 7D30 CAF1 4EFC


signature.asc
Description: Digital signature
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


Re: how to tell what packages are unused on a debian server?

2010-10-29 Thread gun_smoke
On Fri, Oct 29, 2010 at 06:12:55AM -0400, Robert P. J. Day wrote:
 
   just a cleanup-related question but on a debian lenny server that
 i've inherited, i'm curious to know which packages have no value
 whatever and that i can delete.  i recall there's a utility that will
 identify unused libraries but i'm curious about what else i can
 pinpoint that can be removed.
 
   this system is a web/mail server and, since its IP address is
 assigned statically and another system is responsible for all DNS/DHCP
 functionality internally, i conclude that i can remove the
 dhcp-related packages.  that's just one example.
 
   any utilities that can help out in this regard?  thanks.
 
 rday

I'm not that hot with 'find' but I suppose that would be helpful.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20101029142411.ga28...@shellium.org



Re: how to tell what packages are unused on a debian server?

2010-10-29 Thread Chris Davies
Robert P. J. Day rpj...@crashcourse.ca wrote:
  for instance, if a given shared library hasn't been linked in weeks
 or months, that's something to look at.  if none of the binary
 executables in a package have been executed in that long, another
 package to examine, that sort of thing.

You could possibly do something with this, which checks each installed
package for files that have been accessed in the last six months. Please
note, however, that it cannot work if you mount your relevant filesystems
with noatime!

for P in $(dpkg -l '*' | awk '/^i/{print $2}')
do
echo -n Checking $P:  2
U=$(
for F in $(dpkg -L $P)
do
test -f $F  find $F -atime +180
done 2/dev/null
)
test -n $U  echo in use 2 || echo MAYBE NOT USED RECENTLY 2
done

Chris


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/kt1rp7xffn@news.roaima.co.uk



Re: how to tell what packages are unused on a debian server?

2010-10-29 Thread Andrew McGlashan

Hi,

Chris Davies wrote:

Robert P. J. Day rpj...@crashcourse.ca wrote:

 for instance, if a given shared library hasn't been linked in weeks
or months, that's something to look at.  if none of the binary
executables in a package have been executed in that long, another
package to examine, that sort of thing.


You could possibly do something with this, which checks each installed
package for files that have been accessed in the last six months. Please
note, however, that it cannot work if you mount your relevant filesystems
with noatime!

for P in $(dpkg -l '*' | awk '/^i/{print $2}')
do
echo -n Checking $P:  2
U=$(
for F in $(dpkg -L $P)
do
test -f $F  find $F -atime +180
done 2/dev/null
)
test -n $U  echo in use 2 || echo MAYBE NOT USED RECENTLY 2
done


That all looks good Chris, but I tried it and saw no results for in 
use and that makes no sense.  I don't use noatime mount option either.



--
Kind Regards
AndrewM

Andrew McGlashan
Broadband Solutions now including VoIP


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ccaf430.5030...@affinityvision.com.au



Re: how to tell what packages are unused on a debian server?

2010-10-29 Thread Eero Volotinen
2010/10/29 Robert P. J. Day rpj...@crashcourse.ca:

  just a cleanup-related question but on a debian lenny server that
 i've inherited, i'm curious to know which packages have no value
 whatever and that i can delete.  i recall there's a utility that will
 identify unused libraries but i'm curious about what else i can
 pinpoint that can be removed.

  this system is a web/mail server and, since its IP address is
 assigned statically and another system is responsible for all DNS/DHCP
 functionality internally, i conclude that i can remove the
 dhcp-related packages.  that's just one example.

  any utilities that can help out in this regard?  thanks.

Just reinstall server from scratch and only install packages that you need :)

--
Eero


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/aanlktimh-enye_ekudxn+uu0wkh2frjke0aqqqrvv...@mail.gmail.com



Re: how to tell what packages are unused on a debian server?

2010-10-29 Thread Artur Frydel
Robert P. J. Day wrote:

   just a cleanup-related question but on a debian lenny server that
 i've inherited, i'm curious to know which packages have no value
 whatever and that i can delete.  i recall there's a utility that will
 identify unused libraries but i'm curious about what else i can
 pinpoint that can be removed.

   this system is a web/mail server and, since its IP address is
 assigned statically and another system is responsible for all DNS/DHCP
 functionality internally, i conclude that i can remove the
 dhcp-related packages.  that's just one example.

   any utilities that can help out in this regard?  thanks.

 rday

 -- 


 Robert P. J. Day   Waterloo, Ontario, CANADA
 http://crashcourse.ca

 Twitter:   http://twitter.com/rpjday
 LinkedIn:   http://ca.linkedin.com/in/rpjday





-- 
Artur 'Bzyk' Frydel
Always look on the bright side of life.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/slrnicmc0j.4rf.artur.fry...@lapt.bzyk.dyndns.org



Re: how to tell what packages are unused on a debian server?

2010-10-29 Thread Andrei Popescu
On Vi, 29 oct 10, 06:12:55, Robert P. J. Day wrote:
 
   just a cleanup-related question but on a debian lenny server that
 i've inherited, i'm curious to know which packages have no value
 whatever and that i can delete.  i recall there's a utility that will
 identify unused libraries but i'm curious about what else i can
 pinpoint that can be removed.
 
   this system is a web/mail server and, since its IP address is
 assigned statically and another system is responsible for all DNS/DHCP
 functionality internally, i conclude that i can remove the
 dhcp-related packages.  that's just one example.
 
   any utilities that can help out in this regard?  thanks.

Yes, popcon-largest-unused from package popularity-contest.

Regards,
Andrei
-- 
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic


signature.asc
Description: Digital signature


Re: how to tell what packages are unused on a debian server?

2010-10-29 Thread Ron Johnson

On 10/29/2010 08:17 AM, Wolodja Wentland wrote:
[snip]


Another good way to find unused packages is 'popcon-largest-unused' from
the popularity-contest package.



Thanks!

--
Seek truth from facts.


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ccb385a.5080...@cox.net



Re: how to tell what packages are unused on a debian server?

2010-10-29 Thread Chris Davies
Andrew McGlashan andrew.mcglas...@affinityvision.com.au wrote:
 That all looks good Chris, but I tried it and saw no results for in 
 use and that makes no sense.  I don't use noatime mount option either.

Swap the +180 for -180 and try again. (We should be looking for files
accessed *within* the last six months. Duh, sorry!)

Chris


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/3lsrp7xr3u@news.roaima.co.uk



Re: how to tell what packages are unused on a debian server?

2010-10-29 Thread Andrew McGlashan

Chris Davies wrote:

Andrew McGlashan andrew.mcglas...@affinityvision.com.au wrote:
That all looks good Chris, but I tried it and saw no results for in 
use and that makes no sense.  I don't use noatime mount option either.


Swap the +180 for -180 and try again. (We should be looking for files
accessed *within* the last six months. Duh, sorry!)


Okay, I tried the change and let it finish the report.

I found all in use, except for php5, but there is a bunch of php5 
stuff that is in use.


A small chop of the results here:

Checking php-cache-lite: in use
Checking php-fpdf: in use
Checking php-http-request: in use
Checking php-net-checkip: in use
Checking php-net-socket: in use
Checking php-net-url: in use
Checking php-pear: in use
Checking php5: MAYBE NOT USED RECENTLY
Checking php5-cgi: in use
Checking php5-cli: in use
Checking php5-common: in use
Checking php5-curl: in use
Checking php5-gd: in use
Checking php5-mcrypt: in use
Checking php5-mysql: in use
Checking php5-suhosin: in use
Checking phpmyadmin: in use


And then this:

r...@www:/usr/local/bin # aptitude why php5
Sat Oct 30 13:36:23 EST 2010 -- why php5
i   phpmyadmin Depends libapache2-mod-php5 | libapache-mod-php5 | 
php5-cgi | php5 | libapache2-mod-php4 | libapache-mod-php4 | php4 | php4-cgi




[I created my own aptitude front-end which has logging]

If you are interested, here it is:

#!/bin/bash

# System Binaries
APTITUDE=/usr/bin/aptitude
DATE=/bin/date
DPKG=/usr/bin/dpkg
DPKG_QUERY=/usr/bin/dpkg-query
SED=/bin/sed
TEE=/usr/bin/tee

# Variables
APTITUDE_HISTORY_FILE=/root/dpkg.wrk/aptitude-history
INSTALL_HISTORY=/root/dpkg.wrk/install-history

sdpkg='(cd ; cd dpkg.wrk ; $DPKG_QUERY -l  dpkg-query-l-`$DATE 
+%Y%m%d-%H:%M:%S` ; $DPKG --get-selections  dpkg--get-selections-`$DATE 
+%Y%m%d-%H:%M:%S`)'


echo `$DATE` -- $* |$TEE -a $APTITUDE_HISTORY_FILE

if [ $1 == install ]; then
(
echo 
$DATE
echo $APTITUDE $*
$APTITUDE $*
echo 
CMD=`echo $APTITUDE show $*|$SED 's/show install/show/'`
echo $CMD
eval $CMD
echo 
eval $sdpkg
) 21 | $TEE -a $INSTALL_HISTORY
elif [ $1 == safe-upgrade ]; then
(
echo 
$DATE
echo $APTITUDE $*
$APTITUDE $*
echo 
eval $sdpkg
) 21 | $TEE -a $INSTALL_HISTORY
elif [ $1 == purge ]; then
(
echo 
$DATE
echo $APTITUDE $*
$APTITUDE $*
echo 
eval $sdpkg
) 21 | $TEE -a $INSTALL_HISTORY
else
$APTITUDE $*
fi


Cheers

--
Kind Regards
AndrewM

Andrew McGlashan
Broadband Solutions now including VoIP


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ccb8b81.1020...@affinityvision.com.au