rpmorphan - Man Page
find orphaned packages
Description
rpmorphan finds "orphaned" packages on your system. It determines which packages have no other packages depending on their installation, and shows you a list of these packages. It is clone of deborphan debian software for rpm packages.
It will try to help you to remove unused packages, for exemple :
- after a distribution upgrade
- when you want to suppress packages after some tests
Synopsis
rpmorphan [options] [targets]
or
grpmorphan [options] [targets]
using grpmorphan is a short way to use "rpmorphan -gui"
options:
-help brief help message -man full documentation -V, --version print version -verbose verbose -debug debug mode (for developpers only) -dry-run simulate package remove -fullalgo force full algorythm -suggests use suggested package as if required -recommends use recommends package as if required -arch work and show on full name with version and architecture -log-file mylog change default log file to mylog -use-cache use cache to avoid rpm query -clear-cache remove cache file -gui display the graphical interface -tk display the tk graphical interface -curses display the curses graphical interface -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 if pac is an orphan package -all apply on all packages -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 (this is the default target if none is specified) -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
keep file management
-keep-file file define the keep file to be used -list-keep list permanent exclude list -zero-keep empty permanent exclude list -add-keep pac add pac package to permanent exclude list -del-keep pac remove pac package from permanent exclude list
Required Arguments
you should provide at least one target. this can be
- -all
all the installed rpm package
- -package
one or several explicit package
- -guess-*
pre-selected packages groups
- -guess-custom
give a filter to select the packages you want study. you can use regular expressions.
Options
- -help
Print a brief help message and exits.
- -man
Print the manual page and exits.
- -version
Print the program release and exit.
- -verbose
The program works and print debugging messages.
- -debug
for developpers, the program will dump internals structures
- -dry-run
this is a simulation mode : rpmorphan will show you what is the result of package removing. The window's title is modified to show this mode.
- -use-cache
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).
- -clear-cache
to remove cache file. Can be used with -use-cache to write a new cache.
- -gui
display a graphical interface which allow to show informations, remove packages (an internal help is provided). This is currently the same as the -tk option
- -tk
display a tk graphical interface which allow to show informations, remove packages (an internal help is provided). The Tk perl module is necessary to run the gui.
- -curses
display a curses graphical interface which allow to show informations, remove packages (an internal help is provided). The Curses::UI perl module is necessary to run the gui.
- -exclude
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
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
access-time is designed to filter packages which have not been used since x days.
be careful : this option will slow the program
- -fullalgo
for a small list of packages, rpmorphan use a different quicker methode : rpm -e --test
this option can be used to force the use of the full algo
- -suggests
some rpm version offers a meta-data dependency call suggests : it is for usefull but not necessary packages (very weak dependency). if this option is set, the suggested packages are used in rpmorphan as required packages. The default value for this option is unset.
- -recommends
some rpm version offers a meta-data dependency call recommends : it is for usefull but not necessary packages(weak dependency). if this option is set, the recommended packages are used in rpmorphan as required packages. The default value for this option is unset.
- -arch
by default, rpmorphan works on package name. this option will rpmorphan work on full package name : name-version-release.arch. This may be usefull if you have several version or several archictectures installed.
- -log-file
change the default log file (/var/log/rpmorphan.log) to the given file name
- -package
search if the given package(s) is(are) orphaned. Can be used as '--package pac1 --package pac2' or '--package "pac1, pac2"'
- -all
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
- -guess-perl
This option tries to find perl modules. It tries to match "^perl"
- -guess-python
This option tries to find python modules. It tries to match "^python"
- -guess-pike
This option tries to find pike modules. It tries to match "^pike"
- -guess-ruby
This option tries to find ruby modules. It tries to match "^ruby"
- -guess-common
This option tries to find common packages. It tries to match "-common$"
- -guess-data
This option tries to find data packages. It tries to match "-data$"
- -guess-doc
This option tries to find documentation packages. It tries to match "-doc$"
- -guess-data
This option tries to find data packages. It tries to match "-data$"
- -guess-dev
This option tries to find development packages. It tries to match "-devel$"
- -guess-lib
This option tries to find library packages. It tries to match "^lib"
- -guess-all
This is a short to tell : Try all of the above (perl, python ...)
- -guess-custom
this will allow you to specify your own filter. for exemple "^wh" will match whois, whatsnewfm ...
- -keep-file
define the keep file to be used. If not set, the /var/lib/rpmorphan/keep will be used
- -list-keep
list the permanent list of excluded packages and exit.
- -zero-keep
empty the permanent list of excluded packages and exit.
- -add-keep
add package(s) to the permanent list of excluded packages and exit.
Can be used as '--add-keep pac1 --add-keep pac2' or '--add-keep "pac1, pac2"'
- -del-keep
remove package(s) from the permanent list of excluded packages and exit.
Can be used as '--add-keep pac1 --add-keep pac2' or '--add-keep "pac1, pac2"'
Usage
rpmorphan can be useful after a distribution upgrade, to remove packages forgotten by the upgrade tool. It is interesting to use the options "-all -install-time +xx'.
If you want to remove some recent tested packages, my advice is "-all -install-time -xx'.
if you just want to clean your disk, use '-all -access-time xxx'
Files
/var/lib/rpmorphan/keep : the permanent exclude list
/tmp/rpmorphan.cache : cache file to store rpm query. The cache file is common to all rpmorphan tools
/var/log/rpmorphan.log : log of all deleted packages
Configuration
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
Dependencies
rpmorphan uses standard perl module in console mode.
If you want to use the Tk graphical interface, you should install the Tk module (perl-Tk rpm package).
If you want to use the curses interface, you should install the Curses::UI perl module ( perl-Curses-UI rpm package).
If you want to speed up rpmorphan, you should install the RPM2 perl module ( perl-RPM2 rpm package). On mandriva, the URPM perl module (dependency from urpmi) will be used instead.
Examples
- display orphaned libraries
rpmorphan
- display all orphaned packages in a curses interface
rpmorphan --all --curses
- display orphaned packages, not used since one year
rpmorphan --all -access-time +365
- display all orphaned packages, installed in the last 10 days
rpmorphan --all -install-time -10
- display all orphaned packages, installed one month ago (or more)
rpmorphan --all -install-time +30
- display orphaned packages but not weak dependencies
rpmorphan --all --recommends
- display orphaned packages but not all weak dependencies
rpmorphan --all --recommends --suggests
Bugs and Limitations
Virtuals packages are not well (for now) taken in account. Let's see an example : lilo and grub provide 'bootloader' virtual, which is necessary for system boot. if the 2 are installed, they will be shown all 2 as orphans (but you can not remove the 2). If you remove one of them, the other is now longer shown as orphan.
the software can only work with one version of each software : we only treat the first version seen
the code does not use the following rpm tags : Supplements, Enhances
Incompatibilities
not known
Diagnostics
to be written
Notes
this program can be used as "normal" user to show orphans, but you need to run it as supersuser (root) to remove packages or apply changes in the permanent exclude list
access-time and install-time options are "new" features, not available in deborphan tool
For Fedora users : Yum offers a program called 'package-cleanup' which, called with the '--leaves' option, can show quickly a list of unused library packages.
For Mandriva users : the 'urpme --auto-orphans' command show quickly a a list of unused library packages.
Environment
- RPMORPHAN_METHOD
for experts only : allow to force the method used to get rpm data. It can be set to URPM, RPM2 or 'basic' (for external rpm query)
See Also
rpm(1) for rpm call
Exit Status
should be allways 0
License and Copyright
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.
Author
Eric Gerbier
you can report any bug or suggest to gerbier@users.sourceforge.net
Referenced By
rpmdep(1), rpmduplicates(1), rpmextra(1), rpmusage(1).