How to install Mono on macOS so mono works in terminal?

Kevin Mack picture Kevin Mack · Sep 12, 2015 · Viewed 68.2k times · Source

I'm trying to get a Mono install running on a mac (OS X version 10.10.5), and while the install states that it's completed successfully, I'm not able to call mono from the terminal.

To install it, I ran uninstallMono.sh as root to ensure we didn't have any leftover cruft, then ran MonoFramework-MDK-4.0.4.1.macos10.xamarin.x86.pkg. The installer appeared to complete successfully, but an attempt to call mono returns

-bash: mono: command not found

The mono framework does appear to be installed:

Lees-Mac-Pro:Downloads kevinmack$ cd /Volumes/Macintosh\ HD/Library/Frameworks/
Lees-Mac-Pro:Frameworks kevinmack$ ls -l
total 32
lrwxr-xr-x  1 root  wheel   71 Jan 20  2015 AEProfiling.framework -> ../../Applications/Motion.app/Contents/Frameworks/AEProfiling.framework
lrwxr-xr-x  1 root  wheel   74 Jan 20  2015 AERegistration.framework -> ../../Applications/Motion.app/Contents/Frameworks/AERegistration.framework
lrwxr-xr-x  1 root  wheel   74 Jan 20  2015 AudioMixEngine.framework -> ../../Applications/Motion.app/Contents/Frameworks/AudioMixEngine.framework
drwxr-xr-x  8 root  admin  272 Sep 12 11:24 Mono.framework
lrwxr-xr-x  1 root  wheel   60 Sep  9 22:16 NyxAudioAnalysis.framework -> /System/Library/PrivateFrameworks/NyxAudioAnalysis.framework
drwxr-xr-x  5 root  wheel  170 Jan 20  2015 PluginManager.framework
drwxr-xr-x  8 root  wheel  272 Sep  9 22:19 iTunesLibrary.framework

...but it isn't present in /usr/bin and attempting to find its executable using which mono returns nothing.

Answer

Jeffrey Neo picture Jeffrey Neo · Oct 2, 2015

In OS X El Capitan, run the following in Terminal to support mono command

export PATH=/Library/Frameworks/Mono.framework/Versions/Current/bin/:${PATH}