[PKGNG] How to clean up a repository?

As I am keeping my package repository up to date (I use portmaster to build packages in a jail and export them via HTTP), said repository has been accumulating old versions of an increasing number of packages. Is there an easy pkg command to get rid of those, or does this have to be done manually?
 
Unfortunately neither applies. I'm not (currently) using Poudriere and I'm not so much concerned about a local cache of remotely fetched packages either.
 
gnuls -oSr | sort -k 4 | sort -k 8 | [grep -v "t " ] | lookat

One can run that in one terminal [if in [cmd=]X[/cmd] ] and page through the list, building a long remove-all-at-once command line in another terminal, periodically, if need be. Does not take too long, and could be more careful (say, if one does not want to remove all the old packages) if expedient...
 
@fonz asked for an easy way to clean up outdated packages. I don't think you want to go through hundreds of packages manually, no matter how well you present the options.
 
Last edited by a moderator:
Before I set up poudriere I used to simply make a ZFS snapshot of the package directory and then delete the whole lot. I always started a new build run with a fresh jail so all packages got created anyway. Cleaning out distfiles was done by portmaster and the -d switch.
 
fonz said:
As I am keeping my package repository up to date (I use portmaster to build packages in a jail and export them via HTTP), said repository has been accumulating old versions of an increasing number of packages. Is there an easy pkg command to get rid of those, or does this have to be done manually?

portmaster --clean-packages -y

That simple :)
 
iddqd said:
That simple :)
Almost. One does need to (re)move a few files (digests.txz, filesite.txz, packagesite.txz and repo.txz) out of the way that are placed there by pkg repo ... and that cause portmaster to bail out with an error message.
 
Back
Top