rpmusage.pl |
rpmusage - display rpm packages last use
rpmusage will display for each package, the last date it was used (in days). It can be used to find unused packages. It use the atime field of all package's files to do this job. Note : as it scan all files inodes, the run may be long ...
rpmusage.pl [options] [targets]
options:
-help brief help message
-man full documentation
-V, --version print version
-verbose verbose
-fullalgo force full algorythm
-use-cache use cache to avoid rpm query
-clear-cache remove cache file
-exclude pac exclude pac from results
-install-time +/-d apply on packages which are installed before (after) d days
-access-time d apply on packages which are not been accessed for d days (slow)
targets:
-package pac search last access on pac package
-all apply on all packages (this is the default)
-guess-perl apply on perl packages
-guess-python apply on python packages
-guess-pike apply on pike packages
-guess-ruby apply on ruby packages
-guess-common apply on common packages
-guess-data apply on data packages
-guess-doc apply on documentation packages
-guess-dev apply on development packages
-guess-lib apply on library packages
-guess-all apply all -guess-* options (perl, python ...)
-guess-custom regex apply the given regex to filter to package's names to filter the output
it can be used without any argument, and then will apply on all packages
Print a brief help message and exits.
Print the manual page and exits.
Print the program release and exit.
The program works and print debugging messages.
the rpm query may be long (10 to 30 s). If you will run an rpmorphan tool several time, this option will allow to gain a lot of time : it save the rpm query on a file cache (first call), then use this cache instead quering rpm (others calls).
to remove cache file. Can be used with -use-cache to write a new cache.
this option will specify the packages to exclude from the output. Can be used as '--exclude pac1 --exclude pac2' or '--exclude "pac1, pac2"'
install-time is a filter on the period from the package installation date to now (in days). if set positive, it only allow packages installed before x days. if set negative, it only allow packages installed since x days.
access-time is designed to filter packages which have not been used since x days.
be careful : this option will slow the program
for a small list of packages, rpmusage use a different quicker methode : rpm -e --test
this option can be used to force the use of the full algo
search if the given package(s) is(are) orphaned. Can be used as '--package pac1 --package pac2' or '--package "pac1, pac2"'
apply on all installed packages. The output should be interpreted. For example lilo or grub are orphaned packages, but are necessary to boot ...
the "-install-time" and "-access-time" options may be useful to filter the list
This option tries to find perl modules. It tries to match "^perl"
This option tries to find python modules. It tries to match "^python"
This option tries to find pike modules. It tries to match "^pike"
This option tries to find ruby modules. It tries to match "^ruby"
This option tries to find common packages. It tries to match "-common$"
This option tries to find data packages. It tries to match "-data$"
This option tries to find documentation packages. It tries to match "-doc$"
This option tries to find data packages. It tries to match "-data$"
This option tries to find development packages. It tries to match "-devel$"
This option tries to find library packages. It tries to match "^lib"
This is a short to tell : Try all of the above (perl, python ...)
this will allow you to specify your own filter. for exemple "^wh" will match whois, whatsnewfm ...
display all packages in access date order
rpmusage.pl --all | sort -k 2 -n
only ask for perl packages
rpmusage.pl --guess-perl | sort -k 2 -n
to read the output : "python-pexpect 97 on /usr/share/doc/python-pexpect" means the package was last used 97 days ago and the more recently used file was the /usr/share/doc/python-pexpect file
/tmp/rpmorphan.cache : cache file to store rpm query. The cache file is common to all rpmorphan tools
rpmusage uses only standard perl module.
but it needs the rpm command tool.
the software can only work with one version of each software : we only treat the first version seen
the program can read rcfile if some exists. it will load in order
/etc/rpmorphanrc
~/.rpmorphanrc
.rpmorphanrc
In this file,
# are comments,
and parameters are stored in the following format : parameter = value
example :
all = 1
curses = 1
not known
to be written
this program should be used as root superuser, because it needs to access (in read mode) to all files
should be allways 0
Copyright (C) 2006 by Eric Gerbier This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Eric Gerbier
you can report any bug or suggest to gerbier@users.sourceforge.net
rpmusage.pl |