Uninstalling CyberWatch

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
Locked
thomas789
Messages: 95
Registration: May 31, 2021 - 3:44 p.m.

October 22, 2021 - 4:26 PM

Good morning,

(Server console used under Windows 10 and WAPT Enterprise 2.1.0.10550 installed on a Debian 10 server, client 2.1 on Ubuntu 21.04).

I am unable to uninstall my CyberWatch Ubuntu agent using the following code:

Code: Select all

def uninstall():
    run('sudo apt remove --purge cyberwatch-agent')
nor with

Code: Select all

def uninstall():
    apt_remove('cyberwatch-agent')
It remains stuck during uninstallation.

On the workstation, if I do:

Code: Select all

root@PC:~# ps aux | grep -i cyber
root      353952  0.0  0.0   2628   636 ?        S    16:16   0:00 /bin/sh -c sudo apt remove --purge cyberwatch-agent
root      353953  0.0  0.0  23312  4428 ?        S    16:16   0:00 sudo apt remove --purge cyberwatch-agent
root      353956  2.0  0.2  89980 67688 ?        S    16:16   0:00 apt remove --purge cyberwatch-agent
root      354233  0.0  0.0  17784  1848 pts/0    S+   16:17   0:00 grep --color=auto -i cyber
And if I run `apt remove --purge cyberwatch-agent` in parallel on the machine, it returns:

Code: Select all

Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 353956 (apt)      
This seems to logically explain the error, but how do we solve it?

(I also tried adding sudo to my package command but no result).

Thanks in advance,

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

October 28, 2021 - 3:17 PM

Hello Thomas,

You can kill the apt processes to unlock the dpkg database.

In your run, you need to add a -y, otherwise the uninstallation won't be silent. It's also preferable to add the noninteractive parameter

Code: Select all

run("LANG=C DEBIAN_FRONTEND=noninteractive apt-get remove -y --purge cyberwatch-agent")
The `apt_remove()` syntax hasn't existed for quite some time (since Wapt 1.7?). You may have found it in the online documentation; there was some confusion between the different versions recently. The command is

Code: Select all

uninstall_apt("cyberwatch-agent")
Sincerely,

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
Locked