Purging ClamAV on new Server

OS type and version REQUIRED
Virtualmin version REQUIRED

Hi Guys,

I have a quick qestion, and I’m not sure if I should do it.
I set up a new Debian 11 server. Everything is working so far pretty well.
Since I don’t use ClamAV on my VPS, I want to ask you guys, if I can completly purge it away. On the first installation wizard, I actually disabled it. Later, I disabled the stuff in the bootup options in Webmin. But still some of the “leftovers” are spamming my systemd log, So I want to completly remove it out from the system. That’s what the output is from my purge command.

sudo apt purge clamav*

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'clamav-daemon' for glob 'clamav*'
Note, selecting 'clamav-milter' for glob 'clamav*'
Note, selecting 'clamav' for glob 'clamav*'
Note, selecting 'clamav-base' for glob 'clamav*'
Note, selecting 'clamav-testfiles' for glob 'clamav*'
Note, selecting 'clamav-freshclam' for glob 'clamav*'
Note, selecting 'clamav-data' for glob 'clamav*'
Note, selecting 'clamav-unofficial-sigs' for glob 'clamav*'
Note, selecting 'clamav-docs' for glob 'clamav*'
Note, selecting 'clamav-freshclam' instead of 'clamav-data'
Package 'clamav-milter' is not installed, so not removed
Package 'clamav-unofficial-sigs' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  libclamav9 libmspack0 libtfm1 php7.4-mysql
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  clamav* clamav-base* clamav-daemon* clamav-docs* clamav-freshclam* clamav-testfiles* clamdscan*
0 upgraded, 0 newly installed, 7 to remove and 0 not upgraded.
After this operation, 18.6 MB disk space will be freed.
Do you want to continue? [Y/n]

Can I execute this command without problems? I’m just a bit confused about the php7.4-mysql package, which the purge command wants to remove as well…

Thanks already a lot upfront for your help



Note the prefix statement before the “php7.4-mysql” is listed. It says “are no longer required” so it should be safe to allow the uninstall proceed.

If you notice mysql functionality within PHP (assuming you’re using 7.4) stops working, you can then just run apt install php7.4-mysql which would add the package back.

It’s definitely a good idea when doing this type of removal that you observe packages that are being removed just in case you need to add them back later.

Personally, I’m content simply disabling packages that “might” be useful later as the space the utilize is typically minimal.

*** Professional, Affordable, Trusted - Technical Assistance - https://tpnassist.com ***

Read it again. It does not say it will be removed. It would only be removed if you used autoremove, which I generally recommend against, unless you know what you’re doing.

The fact that it can be removed means that it was installed to satisfy a dependency and that dependency is no longer installed or has changed due to updates such that it is no longer requires this package. If you want to keep it regardless of dependencies (if you are using php7.4 for any of your apps you almost certainly do want to keep it), you should install it manually so it is marked as manually installed. (It is already installed, but running apt install php7.4-mysql will mark it as manually installed and will no longer be subject to autoremove.)

But, if you know you’ll never use autoremove, you won’t have to worry about it, either.

1 Like

Thanks a lot to @tpnsolutions and @Joe for all the information. Yes, it’s true, autoremove will remove the PHP 7.4. Well, actually it can go, since I just switched everything to PHP 8 lately.
I just want to make sure, if I can purge these ClamAV packages without problems.
Freshclam writes in my Systemlog every 3 minutes 2x times the following:

secondary systemd[1]: /lib/systemd/system/clamav-freshclam.service:11: Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, and consider removing the setting altogether.

That’s a bit annoying in my opinion, since Freshclam and the Deamon is not running, and I don’t plan to use ClamAV on this server.

Thanks a lot upfront, have a wonderful Tuesday.