Removing older versions from the repo.
Athwale opened this issue · 2 comments
Hi,
Lets say I have:
cups-2.4.7-13.fc39.x86_64
cups-2.4.6-12.fc39.x86_64
cups-2.4.7-11.fc39.x86_64
In the directory which I am using to create a repo.
Is there some option that would delete the older versions of the packages, and only leave the latest cups-2.4.7-13.fc39.x86_64 rpm in the repo?
Thanks.
I don't think there is an crearerepo_c option like that. createrepo_c tool is for creating a repository from a directory. It's not for managing packages in the repository.
However, you can try "mergerepo_c --method nvr REPO REPO_COPY" on two identical copies of a repository. According to manual page it selects the latest package if it has the same name and architecture. Though I'm not sure whether it operates on names recorded inside RPM packages, or on file names the RPM packages has on a file system. I hope it's the former. Just bear in mind that it's a wild guess. I never used mergerepo_c.
Thanks.
It creates a new directory with the merged repo, but it only has repodata, the rpm files are left alone in both the copies.
But I can probably parse the log and remove the packages that were not selected.