$ brew install clamav $ cd /usr/local/etc/clamav $ cp freshclam.conf.sample freshclam.conf Open freshclam.conf and comment the 'Example' (in new version it may be 'FooClam') line: # Comment or remove the line below. Uninstall Office for Mac 2011 Note: You must be signed in as administrator to do these steps, and you probably already are, if you're using your own Mac. If you're at a Mac that's part of a network at work, you might have to ask someone in your IT organization for help with signing in as administrator.
My preferred anti-virus system is ClamAV and I had trouble getting itrunning on macOS recently. Here's how I got it going so if you'rerunning to the same issue, this should solve your problem.
I will go through the steps I took and problems encountered. Thisarticle will take you less than three minutes to read.
To get ClamAV running on macOS, run: brew install clamav
Thanks to brew
, open source software like ClamAV can run on multipleplatforms.
Normally, I would just run the application directly, in this case:clamav
, but that does not exist. The main application is: clamscan
Hmm. What is going on here?
After looking up the man page, man clamscan
, one related package isfreshclam
, that has a description:
freshclam - update virus databases
Aah - let's run freshclam
to update the definition!
Well, there's no such file, or where do I get it? Is there a sample somewhere?
Well, it turns out I missed a critical line in the brew
install, which was:
To finish installation & run clamav you will need to editthe example conf files at /usr/local/etc/clamav/
🤦♂️ whoops! I didn't even look (and only when writing up this article,I noticed it).
Let's make the freshclam.conf
file by running command:
Change the following in the file from:
To:
Running the freshclam
application again results in:
Great! Now macOS can scan virus too!
I can't take credit for everything, I found this githubcommentthat basically describes the solution I presented.
I have this article as a way for me to remember but also remind myselfof apps that are better on Linux than macOS.
Getting ClamAV running on macOS isn't that hard, but I was close togiving up!.
I love using open source software and macOS. As macOS is UNIX based,almost all open source software works on macOS.
There are times where just using Linux to run open source software isa better experience than macOS. ClamAV is one of those times.
Hopefully, this post has helped you from giving up on open sourcesoftware!
ClamXav can be downloaded directly or through the Mac App Store. The Mac App Store version does not contain the Sentry tool that allows constant scanning for changes by folder, so this tutorial is for the download version which you can get at http://www.clamxav.com/.
Note: ClamXav used to be free but as of June 2015 is a commercial product. I think it's well worth the $30 and by paying for it I'm helping to ensure the development of the product continues.
After installation, log out of your Mac and back in.
Starting
When you first launch ClamXav it's a good idea to update the Virus Definitions. Next let's set some preferences.
General Preferences
- You can set these as you desire, especially the audible alerts
- Believe it or not, UNcheck scanning your email for malware. Your spam filter will catch most of this and put it in a spam bucket but ClamXav will stil find it and give you CONSTANT popups about it. I also don't update virus definitions on launch because we'll put it on a schedule in a later step. I DO however allow the application to check for updates on launch like any other program. It might seem odd also to UNcheck update virus definitions on launch, but we're going to do that on a schedule instead in a later step.
- Click on the Sentry tab next.
Sentry
Sentry keeps an eye on any folder you choose. We're going to set it to watch your Downloads folder, because that's where new stuff shows up that we want scanned. This is the feature you only get if you buy directly from ClamXav.com and is not available in the Mac App Store version.
Drag Home Folder Into the Window
Drag your Downloads folder into the window. Alternatively you can push the plus button and navigate to your Downloads folder.
Your Downloads Folder Will Now be Monitored
- Verify – you should see simply ~/Downloads in the folders being watched.
- Click on the Schedule tab next.
Schedule
It's a good idea to allow virus definitions to be updated daily so set the pulldown to a time you're sure your machine will be on. Now simply let ClamXav run and hope you never hear back from it!
Run a Full Scan
Run a full scan of your home folder. This took about 3 hours for my very large home folder. It found 450 .emix files, where are all Mail files that are probably in my spam and junk mail folders. Once the scan is done, you can right click on the files and show where they are in the finder, or you can simply choose delete from that menu, or select them all and hit command-delete.
Now that your machine is clean, you can rely on Sentry to watch for changes and to scan only those changes.
ClamXav can be downloaded directly or through the Mac App Store. The Mac App Store version does not contain the Sentry tool that allows constant scanning for changes by folder, so this tutorial is for the download version which you can get at http://www.clamxav.com/.
Note: ClamXav used to be free but as of June 2015 is a commercial product. I think it's well worth the $30 and by paying for it I'm helping to ensure the development of the product continues.
After installation, log out of your Mac and back in.
Starting
When you first launch ClamXav it's a good idea to update the Virus Definitions. Next let's set some preferences.
General Preferences
- You can set these as you desire, especially the audible alerts
- Believe it or not, UNcheck scanning your email for malware. Your spam filter will catch most of this and put it in a spam bucket but ClamXav will stil find it and give you CONSTANT popups about it. I also don't update virus definitions on launch because we'll put it on a schedule in a later step. I DO however allow the application to check for updates on launch like any other program. It might seem odd also to UNcheck update virus definitions on launch, but we're going to do that on a schedule instead in a later step.
- Click on the Sentry tab next.
Sentry
Sentry keeps an eye on any folder you choose. We're going to set it to watch your Downloads folder, because that's where new stuff shows up that we want scanned. This is the feature you only get if you buy directly from ClamXav.com and is not available in the Mac App Store version.
Drag Home Folder Into the Window
Drag your Downloads folder into the window. Alternatively you can push the plus button and navigate to your Downloads folder.
Your Downloads Folder Will Now be Monitored
- Verify – you should see simply ~/Downloads in the folders being watched.
- Click on the Schedule tab next.
Schedule
It's a good idea to allow virus definitions to be updated daily so set the pulldown to a time you're sure your machine will be on. Now simply let ClamXav run and hope you never hear back from it!
Run a Full Scan
Run a full scan of your home folder. This took about 3 hours for my very large home folder. It found 450 .emix files, where are all Mail files that are probably in my spam and junk mail folders. Once the scan is done, you can right click on the files and show where they are in the finder, or you can simply choose delete from that menu, or select them all and hit command-delete.
Now that your machine is clean, you can rely on Sentry to watch for changes and to scan only those changes.
Scan On Demand
Clamav Windows
ClamXav also installs a Service that lets you scan a file or folder at any time. Simply right click on the file or folder you want to scan, pull down to Services, and choose Scan with ClamXav. The application will run and show you the results of the scan.
Clamav Mac Os
Log out and back into your account for the contextual menus to be available under Services.