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

Re: Finding unused packages



On Fri, 2002-04-19 at 16:46, Gary Turner wrote:
> On Fri, 19 Apr 2002 09:59:34 -0400, Noah Meyerhans wrote:
> 
> >On Fri, Apr 19, 2002 at 03:00:34PM +0200, Matijs van Zuijlen wrote:
> >> > Some time ago, I've read somewhere about a tool that can find installed 
> >> > debian packages that are not used, based on atime of files that belong to 
> >> > the packages.
> snip
> >
> >There have been several programs written to track down unused packages.
> >The one I know of off-hand is 'deborphan'.  I'm not sure if it's the
> >standard or if there's a better one out there, though.
> 
> deborphan looks for files that have no other files depending on them.
> As the op said, this is not what he is looking for.  This non-hacker is
> thinking that a script that steps through the various /bin directories,
> checking and sorting the last access for each file would be what Marijs
> is looking for. For example,
> 
> 	find -atime +30 -maxdepth 1
> 
> yields any file in the current directory that hasn't been accessed in
> the last 30 days.  I would think the next step would be to see which
> package those long unused binaries belong to.  This I leave as an
> exercise for the class :^)
> --
> gt
> Everything here could be wrong--Messiah's Handbook--Bach

Right, I think I'm *nearly* there...

Here we go:

find / -type f -atime +30 | xargs dpkg -S | sort | uniq > old.txt

There's an obvious problem - it hits up every file, regardless. I
certainly haven't accessed a lot of the non-English localisation files
on my system in like forever, and old.txt is a resultant 700K in size.

What we need to do is tell "find" to only find files that have
executable bits set, with the -perm switch - however, the following:

find / -type f -atime +30 perm ugo+x | xargs dpkg -S | sort | uniq >
old.txt 

doesn't return anything. Can someone point out the staggering (yet quite
invisible to me) stupidity I'm undoubtedly committing?

Regards

Peter.

-- 
Peter Whysall
peter.whysall@ntlworld.moc
The TLD in my email address is sdrawkcab.
Debian GNU/Linux 3.0 sid -- kernel 2.4.18

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: