[RESOLVED] Wapt-Clean

Share your tips or issues concerning the WAPT Console or WAPT Agent here
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
Locked
User avatar
guigeek
Messages: 147
Registration: Nov 21, 2017 - 9:21 p.m.

February 13, 2026 - 09:08

Hello everyone!
I'm on version 2.6.1.17705-80 on the agents, and after a disk space issue on some machines, I've noticed that the `wapt-get clean` command doesn't delete the MSU files related to Microsoft updates located in C:\Program Files (x86)\wapt\private\cache.
Is this normal?
Is there another way to delete these files?
Thanks and have a good day,
Guillaume
User avatar
guigeek
Messages: 147
Registration: Nov 21, 2017 - 9:21 p.m.

March 12, 2026 - 10:15

Person ?
kcherel
Messages: 1
Registration: January 12, 2026 - 10:01

March 12, 2026 - 5:13 PM

Hello guigeek,

You can try using this script to delete the files located in C:\Program Files (x86)\wapt\cache and C:\Program Files (x86)\wapt\private\cache

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *

def install():

    print("Nettoyage du repertoire C:\Program Files (x86)\wapt\private\cache")
    WAPT.cleanup(obsolete_only=False)

    cache_dir = makepath(WAPT.wapt_base_dir, 'cache')
    print("Nettoyage du repertoire /private/cache")

    if isdir(cache_dir):
        print('Suppression des données dans C:\\Program Files (x86)\\wapt\\cache (sauf icons)')
        for item in os.listdir(cache_dir):
            if item.lower() == 'icons':
                continue

            item_path = makepath(cache_dir, item)
            try:
                if isdir(item_path):
                    remove_tree(item_path)
                elif isfile(item_path):
                    remove_file(item_path)
            except Exception as e:
                print(f"[INFO] Impossible de supprimer {item_path} (ignoré) : {e}") 
If you want to clean up the various binaries in the Windows Update cache (C:\Windows\SoftwareDistribution), you can also deploy the "tis-clean-softwaredistribution" package.

Sincerely,
Kevin.
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

March 12, 2026 - 5:39 PM

@guigeek

The files should be deleted from this directory after installation. But there must be a bug somewhere...

Hubert, Simon, and I took a quick look a few weeks ago, and there seems to be a problem with the fact that after installation, the status isn't UPTODATE but rather NEED_REBOOT. Therefore, the engine has to wait for confirmation after a reboot that everything is OK, but after a reboot, the next scan and the status change, for some reason, don't seem to clean things up... We're investigating.

In the meantime, you can push the code suggested by Kevin to free up space while waiting for a fix.

Also, if you have peercache enabled, the file is probably also in the peercache cache, so that wastes twice as much space... To be continued.

Best regards,

Denis
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
User avatar
guigeek
Messages: 147
Registration: Nov 21, 2017 - 9:21 p.m.

March 13, 2026 - 3:24 PM

Thank you for these answers!
Locked