I am battling to install ClamAV on my Macbook with macOS Monterey. I am new to open-sourced software and using mac's Terminal commands to solve problems. I have followed online advice and advice from a colleague up to a point, and it just is not working.
- I downloaded ClamAV 0.105.1 for Mac here https://www.clamav.net/downloads.
- Based on this advice https://herrbischoff.com/2021/03/how-to-install-and-run-clamav-on-macos/ I downloaded and installed HomeBrew, apparently successfully.
- I ran "brew install clamav", which ran some thingies and finished up with:
==> Pouring clamav--0.105.1.arm64_monterey.bottle.tar.gz
==> Caveats To finish installation & run clamav you will need to edit the example conf files at /opt/homebrew/etc/clamav/
==> Summary /opt/homebrew/Cellar/clamav/0.105.1: 177 files, 25.4M
==> Running brew cleanup clamav
... Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP. Hide these hints with HOMEBREW_NO_ENV_HINTS (see man brew
).
==> Caveats
==> clamav To finish installation & run clamav you will need to edit the example conf files at /opt/homebrew/etc/clamav/
- I can't recall where I went for help with what to do next, but I recorded that I ran the following [bobmcbob being stand in for my actual user name]:
bobs-MacBook-Air-2:~ bobmcbob$ cp /usr/local/etc/clamav/freshclam.conf.sample /usr/local/etc/clamav/freshclam.conf
cp: /usr/local/etc/clamav/freshclam.conf.sample: No such file or directory
bobs-MacBook-Air-2:~ bobmcbob$ sed -i '' 's/Example/# Example/' /usr/local/etc/clamav/freshclam.conf
sed: /usr/local/etc/clamav/freshclam.conf: No such file or directory
bobs-MacBook-Air-2:~ bobmcbob$ cp /usr/local/etc/clamav/freshclam.conf.sample /usr/local/etc/clamav/freshclam.conf
cp: /usr/local/etc/clamav/freshclam.conf.sample: No such file or directory
bobs-MacBook-Air-2:~ bobmcbob$ cp /usr/local/etc/clamav/freshclam.conf.sample /usr/local/etc/clamav/freshclam.conf
cp: /usr/local/etc/clamav/freshclam.conf.sample: No such file or directory
bobs-MacBook-Air-2:~ bobmcbob$ cp /usr/local/etc/clamav/freshclam.conf.sample /usr/local/etc/clamav/freshclam.conf
cp: /usr/local/etc/clamav/freshclam.conf.sample: No such file or directory
bobs-MacBook-Air-2:~ bobmcbob$ cd /usr/local/etc/clamav
-bash: cd: /usr/local/etc/clamav: No such file or directory
bobs-MacBook-Air-2:~ bobmcbob$
- I then contacted a colleague and told them: "I have been stumped at this instruction: To finish installation & run clamav you will need to edit the example conf files at /opt/homebrew/etc/clamav/". You will see that instruction above.
- My colleague advised me to run the following:
sudo mkdir /usr/local/sbin
sudo chown -R whoami
:admin /usr/local/sbin
brew link clamav
cd /usr/local/etc/clamav
cp freshclam.conf.sample freshclam.conf
sed -ie s/^Example/#Example/g
fresh.conf
- This, they said, would "install clamav, switch to the installation directory make a copy of the configuration file; then modify the configuration file to allow clamav function"
- However I got stumped at the second one sudo chown -R
whoami
:admin /usr/local/sbin ...The outcome was this:
chown: :admin: No such file or directory
- I then tried this, having removed the space from
whoami
:admin: towhoami
:admin This is what happened:
bobmcbob@bobs-MacBook-Air-2 ~ % sudo chown -R whoami
:admin /usr/local/sbin
Password:
bobmcbob@bobs-MacBook-Air-2 ~ %
bobmcbob@bobs-MacBook-Air-2 ~ % brew link clamav
Warning: Already linked: /opt/homebrew/Cellar/clamav/0.105.1
To relink, run:
brew unlink clamav && brew link clamav
bobmcbob@bobs-MacBook-Air-2 ~ % brew unlink clamav && brew link clamav
Unlinking /opt/homebrew/Cellar/clamav/0.105.1... 46 symlinks removed.
Linking /opt/homebrew/Cellar/clamav/0.105.1... 46 symlinks created.
bobmcbob@bobs-MacBook-Air-2 ~ % cd /usr/local/etc/clamav
cd: no such file or directory: /usr/local/etc/clamav
bobmcbob@bobs-MacBook-Air-2 ~ %
I just don't know what to do next, and would be grateful for some help.