A Script to Tidy a Cache of RPM Files
The tidy-rpm-cache.py script deletes obsolete package files by comparing the version information of all RPM files which provide the same software package. You can specify any number of paths of directories to search and you can also exclude specific packages from being tested for obsolescence.
To run this script, simply specify the path of a directory containing RPM package files using the --dir option. For example, to tidy the directory /tmp/packages, execute the following command:
The script will display a list of RPM packages it has deemed as obsolete and ask for confirmation before deleting them from the filesystem. To disable the confirmation message, add the --force option.
The script does not require any special installation procedure and can be run from any location. You may however need to execute it as root in order to be able to actually delete files. The following example shows how to copy the script to a location that is accessible by all users:
tar xzf tidy-rpm-cache-rev*.tar.gz
cp tidy-rpm-cache/tidy-rpm-cache.py /usr/local/bin/
The package includes a file called README.txt which contains documentation for the script.
The command-line options for this script are summarised below and also at the top of the source file tidy-rpm-cache.py. You may wish to use the Python tool pydoc to view the documentation in the source file in a man-style format or to generate a HTML version of the documentation.
In a hurry? Add it to your Download Basket!
What's New in version 1216
- Fixed a bug in the results table formatting code which could cause the program to exit unexpectedly.