Delete Obsolete RPMs script

Deleting Obsolete RPM Files from a Directory
Download

Delete Obsolete RPMs script Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL v3
  • Price:
  • FREE
  • Publisher Name:
  • Darwin Slattery
  • Publisher web site:
  • http://www.hyperdrifter.com/

Delete Obsolete RPMs script Tags


Delete Obsolete RPMs script Description

Deleting Obsolete RPM Files from a Directory Delete Obsolete RPMs script is a script that can used to deleting obsolete RPM files from a directory.The Python script included on this page deletes obsolete RPM package files from a directory. RPM is a software management system used on many Linux distributions including Fedora. This script may be useful if you wish to minimise the disk space requirement of locally stored update packages.Usage Synopsisrm_obsolete_rpms.py {-d|--dir=dir} {-n|--num-obsolete=number} {-x|--exclude=reg-ex} {-f|--force} {-s|--srpm} {-v|--verbose} {-q|--quiet} {--log-prefix=text} {-u|--usage} {-h|--help} {--version}This script deletes obsolete files by comparing the version information of all RPM package 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 delete obsolete RPMs from the directory '/tmp/packages', execute the following command:rm_obsolete_rpms.py --dir=/tmp/packagesThe 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.You can also configure the script to keep a specific number of obsolete versions of a package. For example, if you wish to keep one obsolete version of each package in case the newest version causes problems, you can achieve this using the following command:rm_obsolete_rpms.py --dir=/tmp/packages --num-obsolete=1Note that the --num-obsolete option specifies the number of versions to keep excluding the newest version of the package. In this case all but the newest and the second newest versions would be deleted.To prevent the deletion of specific packages you can supply a regular expression which will be tested against all RPM package filenames. If the expression matches, then that RPM will be excluded from the obsolescence test. For example, to exclude all kernel packages, execute the following command:rm_obsolete_rpms.py --dir=/tmp/packages --exclude='^kernel.*'Note: always enclose the regular expressions in single quotes to prevent them being interpreted as a glob expression.To see more information about what the script is doing and what packages it is examining, add the --verbose option. To disable all output except warning and error messages, add the --quiet option.For more information on these and other options, please read the help information provided with the script. You can access this by adding the --help option. For example:rm_obsolete_rpms.py --helpMinimising the Size of a YUM Cache DirectoryThe reason for writing this script was to provide a feature missing in the current implementation of YUM. YUM is an RPM-based software management system which provides an option to keep downloaded package files in a cache directory for later use. It does not however provide a feature to delete package files which have become obsolete because a newer version of the same package has been downloaded. The following command could be executed manually or from a cron script to clean the default cache directory on Fedora Linux systems:rm_obsolete_rpms.py --dir=/var/cache/yum --forceTest SystemFedora 9python 2.5.1-25rpm-python 4.4.2.3-2 Requirements: · Python · rpm-python


Delete Obsolete RPMs script Related Software