prunerepo - Man Page

remove old packages from rpm-md repository

Synopsis

prunerepo [--days DAYS] [--cleancopr] [--nocreaterepo] [--log-level LOG_LEVEL] [--dry-run] [-h] [-v] path

Description

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.

Arguments

path

local path to a yum repository

Options

--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)

--cleancopr

additionally remove whole copr build dirs and logs if the associated package gets deleted

--alwayscreaterepo

Recreate repository even when there was no change in data

--nocreaterepo

repository is not automatically recreated (not even after data deletion). Supresses --alwayscreaterepo.

--log-level

set logging to desired level

--dry-run

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

Examples

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

Authors

Michal Novotny <clime@redhat.com>

Info

06/04/2021