PRUNEREPO(1)

πŸ“¦
version 1.26 Β· 3 versions
, in epel 10, epel 9

πŸ’… PRUNEREPO(1) πŸ’…

okay so bestie, welcome to the prunerepo manual page, the little glow-up glockenspiel that keeps your rpm-md repo from becoming a hoarder house πŸŽ€ she's a one-trick pony in the best way: old packages? gone. metadata? rebuilt. no cap.


🌸 SYNOPSIS 🌸

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

(that synopsis is literally the whole personality ✨)


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe ✨ RPM packages that have a newer version available in that same repository get yeeted from the filesystem, and then the rpm-md metadata gets recreated afterwards. icon behavior, honestly.

and it gets better 🫢 if there's a source rpm for a deleted rpm β€” and they both share the same directory path β€” then that source rpm gets deleted too. matching set, going down together, it's giving ride or die πŸ’€

she also has support for specific repository structures (e.g. COPR) πŸ‘‘ which makes it possible to additionally remove build logs and whole build directories associated with a package. full clean-out, main character energy.

and after all the obsoleted packages are deleted, she runs:

createrepo_c --database --update

to recreate the repository metadata. periodt. πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • path β€” local path to a yum repository. like, the actual folder. on your actual disk. πŸ’–

✨ OPTIONS ✨

  • --days DAYS β€” only remove packages (and build directories, when --cleancopr is in play) that are DAYS old or older. for packages it's by their build date; for directories it's the last modification time that counts. so she's checking two different clocks, iykyk ⏰
  • --cleancopr β€” additionally remove whole copr build dirs and logs if the associated package gets deleted. the deep clean πŸ”₯
  • --alwayscreaterepo β€” Recreate repository even when there was no change in data. she's gonna rebuild anyway, just because πŸ’β€β™€οΈ
  • --nocreaterepo β€” repository is not automatically recreated (not even after data deletion). and yes, it Suppresses --alwayscreaterepo β€” the two do not coexist, bestie, one of them wins 😀
  • --log-level β€” set logging to desired level. tell her how chatty you want her πŸ—£οΈ
  • --dry-run β€” do not remove anything from the repository and print the actions instead. and heads up: Verbose mode will be set. she narrates the whole thing 🎬
  • -h, --help β€” show this help message and exit. the classic 🫢
  • -v, --version β€” print program version and exit. just the numbers, no drama 🧚

πŸ’œ EXAMPLES πŸ’œ

prunerepo /path/to/repo

removes all packages for which a newer version is available in the repository. the og move πŸ’…

prunerepo /path/to/repo --cleancopr

the same thing but also removes copr-specific build directories if they no longer contain any srpm/rpm package. crumbs cleaned, floor swept 🧹✨

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. the grace period, the mercy, the protective lil bubble 🫧

prunerepo /path/to/repo --days 7 --nocreaterepo

the same thing but omits call to createrepo_c at the end. she deletes, she does not rebuild. no follow-through, respectfully 😭


πŸ‘‘ AUTHORS πŸ‘‘

Michal Novotny <clime@redhat.com> β€” the legend who made this whole thing happen, we stan 🌈


fr fr do not come for me if you skip reading the options β€” --dry-run exists specifically so you can vibe check before anything gets deleted. use it, bestie πŸ™ˆ

okay that's the whole page!! this was prunerepo(1), manual page, dated 02/18/2025 β€” now go clean that repo up, you absolute icon πŸ’–βœ¨πŸŽ€πŸ¦‹πŸ’…

πŸ“¦ where this page comes from