Skip to content

Instantly share code, notes, and snippets.

@valentin-hc
Created May 12, 2023 11:27
Show Gist options
  • Save valentin-hc/085d987031d713de0340994373575045 to your computer and use it in GitHub Desktop.
Save valentin-hc/085d987031d713de0340994373575045 to your computer and use it in GitHub Desktop.

MAC M1 or similar clamav installation process

If like me you had to install clamav and clamd on a macbook with M1 processor, this might be helpful.

brew install clamav

cd /usr/local/etc/clamav/

cp freshclam.conf.sample freshclam.conf

cp clamd.conf.sample clamd.conf

edit clamd.conf and freshclam.conf so Example is commented image

freshclam

This should download the VIRUS DB

Then you should be able to run clamscan of the repository

Then you need to be able to run clamd when in the repo, but most probably you will get an error like this: -bash: clamd: command not found

If this is the case, it means brew didn’t install clamd properly. It is probably in sbin, and needs to be copied to bin.

Go to /usr/local and do cd bin and then ls. If there clamd doest not appear you need to go back to /usr/local then do cd sbin and check that clamd is indeed there. Even from there if you run clamdyou get the same error. If it is like that, go back to /usr/local

And run cp sbin/clamd bin/clamd

Then if you try to run clamd you should get another error, something like that:

clamd ERROR: Please define server type (local and/or TCP).

If this is the case, you need to go back to editing clamd.conf

You need to find and uncomment, or simply add the following:

TCPSocket 3310

TCPAddr localhost

Then you should finally be able to run clamd, clamdtop to check its status and clamdscan inside the repo, so that Clamby gem can work properly.

Good luck.

@prpetten
Copy link

prpetten commented Oct 26, 2023

Homebrew now installs the conf files at /opt/homebrew/etc/clamav/

You can also get clamd to run by adding export PATH="/opt/homebrew/sbin:$PATH" to your ~/.zshenv or ~/.bash_profile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment