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

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



Hi,

Chris Davies wrote:
Robert P. J. Day <rpjday@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


Reply to: