Page 1 of 2

Cleaning old version package

Published: August 21, 2026 - 3:37 PM
by Kevin-LH76
Hello,

we have packages that update regularly, unfortunately this generates many versions on the server.
Is it possible to clean them up, keeping a minimum number of versions and thus automatically freeing up disk space?

Regards

Re: Cleaning up old version package

Published: August 21, 2026 - 4:35 PM
by sfonteneau
Hello

, you can right-click in the private repository and you will see "Select obsolete packages".

You can then modify the selection or delete them directly.

Re: Cleaning up old version package

Published: August 21, 2026 - 4:47 PM
by Kevin-LH76
Hello,

the goal would be to automate it and avoid having to do it manually.

Regards.

Re: Cleaning up old version package

Published: August 21, 2026 - 4:52 PM
by sfonteneau
Hello,

we hadn't planned for that. A dedicated script would be needed.

Re: Cleaning up old version package

Published: August 21, 2026 - 4:56 PM
by Kevin-LH76
We have an auto_update_package script; is there a command via wapt-get to perform this action?

Re: Cleaning up old version package

Published: August 21, 2026 - 5:06 PM
by sfonteneau
No, none. The command was deemed too dangerous and was not implemented.

Use this script as a guide to identify the latest version of each available package:

https://github.com/comitari/wapt-packag ... r/setup.py

The removal process is as follows:

List all packages.
Identify the latest version of each package present in the repository for each machine. (The code already does this.)
Remove all packages not in the previously calculated list

. Delete using https://www.wapt.fr/fr/doc/wapt-api.htm ... ges-delete

Re: Cleaning up old version package

Published: August 21, 2026 - 5:07 PM
by Kevin-LH76
I'll take a look at that, thanks

Re: Cleaning up old version package

Published: August 21, 2026 - 7:56 PM
by Kevin-LH76
Hello,

with the help of your message and documentation, I retrieved the list of packages and their current versions.

However, I'm having trouble finding all the versions of a package in order to remove the one that differs from the current version.

Re: Cleaning up old version package

Published: August 23, 2026 - 3:28 PM
by Kevin-LH76
I tried to retrieve the list via the API with the following request:

Code: Select all

/api/v3/packages?filter=package:tcfpkg-microsoft-defender-antivirus-definition-update&reachable=1&columns=package,id,version&limit=2000
The options do not seem to work with the Package resource, whereas I have no problem with the Hosts resource.

I tried testing with the reporting tab of the console and it works very well.

Code: Select all

SELECT package, name , version , id from packages where package = 'tcfpkg-microsoft-defender-antivirus-definition-update' and version <> '1.457.304.0-312'

Re: Cleaning up old version package

Published: August 24, 2026 - 10:06 AM
by sfonteneau
You have to go through /packages as it is done in the code I gave previously, it is much cleaner because it is the real data.