prunerepo [--days DAYS] [--cleancopr] [--nocreaterepo] [--log-level LOG_LEVEL] [--dry-run] [-h] [-v] path
RPM packages that have newer version available in that same repository are deleted from filesystem and the rpm-md metadata are recreated afterwards. If there is a source rpm for a deleted rpm (and they both share the same directory path), then the source rpm will be deleted as well.
Support for specific repository structure (e.g. COPR) is also available making it possible to additionally remove build logs and whole build directories associated with a package.
After deletion of obsoleted packages, the command "createrepo_c --database --update" is called to recreate the repository metadata.
local path to a yum repository
- --days DAYS
only remove packages (and build directories when --cleancopr is used) that are DAYS old or older (for packages by their build date, for directories the last modification time is considered)
additionally remove whole copr build dirs and logs if the associated package gets deleted
Recreate repository even when there was no change in data
repository is not automatically recreated (not even after data deletion). Supresses --alwayscreaterepo.
set logging to desired level
do not remove anything from the repository and print the actions instead. Verbose mode will be set.
- -h, --help
show this help message and exit
- -v, --version
print program version and exit
- prunerepo /path/to/repo
removes all packages for which a newer version is available in the repository
- prunerepo /path/to/repo --cleancopr
the same thing but also removes copr-specific build directories if they no longer contain any srpm/rpm package
- prunerepo /path/to/repo --days 7
does not delete a package built in last 7 days even if a newer version is available for it
- prunerepo /path/to/repo --days 7 --nocreaterepo
the same thing but omits call to createrepo_c at the end
Michal Novotny <firstname.lastname@example.org>