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

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



Chris Davies wrote:
Andrew McGlashan <andrew.mcglashan@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:

root@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
        ) 2>&1 | $TEE -a $INSTALL_HISTORY
elif [ "$1" == "safe-upgrade" ]; then
        (
        echo "================"
        $DATE
        echo $APTITUDE $*
        $APTITUDE $*
        echo "================"
        eval $sdpkg
        ) 2>&1 | $TEE -a $INSTALL_HISTORY
elif [ "$1" == "purge" ]; then
        (
        echo "================"
        $DATE
        echo $APTITUDE $*
        $APTITUDE $*
        echo "================"
        eval $sdpkg
        ) 2>&1 | $TEE -a $INSTALL_HISTORY
else
        $APTITUDE $*
fi


Cheers

--
Kind Regards
AndrewM

Andrew McGlashan
Broadband Solutions now including VoIP


Reply to: