Cleaning old version package

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Kevin-LH76
Messages: 23
Registration: February 8, 2026 - 5:57 PM

August 21, 2026 - 3:37 PM

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
User avatar
sfonteneau
WAPT Expert
Messages: 2363
Registered: July 10, 2014 - 11:52 PM
Contact :

August 21, 2026 - 4:35 PM

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.
Kevin-LH76
Messages: 23
Registration: February 8, 2026 - 5:57 PM

August 21, 2026 - 4:47 PM

Hello,

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

Regards.
User avatar
sfonteneau
WAPT Expert
Messages: 2363
Registered: July 10, 2014 - 11:52 PM
Contact :

August 21, 2026 - 4:52 PM

Hello,

we hadn't planned for that. A dedicated script would be needed.
Kevin-LH76
Messages: 23
Registration: February 8, 2026 - 5:57 PM

August 21, 2026 - 4:56 PM

We have an auto_update_package script; is there a command via wapt-get to perform this action?
User avatar
sfonteneau
WAPT Expert
Messages: 2363
Registered: July 10, 2014 - 11:52 PM
Contact :

August 21, 2026 - 5:06 PM

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
Kevin-LH76
Messages: 23
Registration: February 8, 2026 - 5:57 PM

August 21, 2026 - 5:07 PM

I'll take a look at that, thanks
Kevin-LH76
Messages: 23
Registration: February 8, 2026 - 5:57 PM

August 21, 2026 - 7:56 PM

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.
Kevin-LH76
Messages: 23
Registration: February 8, 2026 - 5:57 PM

August 23, 2026 - 3:28 PM

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'
User avatar
sfonteneau
WAPT Expert
Messages: 2363
Registered: July 10, 2014 - 11:52 PM
Contact :

August 24, 2026 - 10:06

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.
Answer