Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uninstall Mono from Mac OS X v10.5 Leopard

Tags:

I installed Mono on my iMac last night and I immidiately had a change of heart! I don't think Mono is ready for prime time.

The Mono website says to run the following script to uninstall:

#!/bin/sh -x
#This script removes Mono from an OS X System.  It must be run as root
rm -r /Library/Frameworks/Mono.framework
rm -r /Library/Receipts/MonoFramework-SVN.pkg
cd /usr/bin
for i in `ls -al | grep Mono | awk '{print $9}'`; do
rm ${i}
done 

Has anyone had to uninstall Mono? Was it as straight forward as running the above script or do I have to do more? How messy was it? Any pointers are appreciated.

like image 673
Mac Avatar asked Sep 16 '08 17:09

Mac


4 Answers

The above script simply deletes everything related to Mono on your system -- and since the developers wrote it, I'm sure they didn't miss anything :) Unlike some other operating systems made by software companies that rhyme with "Macrosoft", uninstalling software in OS X is as simple as deleting the files, 99% of the time.. no registry or anything like that.

So, long story short, yes, that script is probably the only thing you need to do.

like image 106
Adrian Petrescu Avatar answered Nov 10 '22 14:11

Adrian Petrescu


Year 2017 answer for those, like myself, looking at SE first and official docs later (FYI I know the question was for OS Leopard). Run these commands in the terminal:

sudo rm -rf /Library/Frameworks/Mono.framework
sudo pkgutil --forget com.xamarin.mono-MDK.pkg
sudo rm -rf /etc/paths.d/mono-commands
like image 43
montrealist Avatar answered Nov 10 '22 15:11

montrealist


Seems the uninstall script has been slightly modified as today (2011-07-12):

#!/bin/sh -x

#This script removes Mono from an OS X System.  It must be run as root

rm -r /Library/Frameworks/Mono.framework

rm -r /Library/Receipts/MonoFramework-*

for dir in /usr/bin /usr/share/man/man1 /usr/share/man/man3 /usr/share/man/man5; do
   (cd ${dir};
    for i in `ls -al | grep /Library/Frameworks/Mono.framework/ | awk '{print $9}'`; do
      rm ${i}
    done);
done

You can find the current version here.

By the way: it's the same exact thing that runs the uninstaller mentioned by joev (although as jochem noted it is not located in the /Library/Receipts, it must be found in the installation package=.

like image 36
Albireo Avatar answered Nov 10 '22 13:11

Albireo


To expand on feelingsofwhite.com's answer, the Mono installer for Mac OS puts the uninstall script in the /Library/Receipts directory, not in the installer image as it says in the Notes.rtf file. The Receipts directory is what the Mac OS Installer.app uses to keep track of which packages were responsible for installing which files. Usually, a list of these is kept in a .bom ("Bill of Materials") file, which can be explored with the lsbom command.

In the case of Mono, they also add a whole bunch of links from your /usr/bin and man directories. Their uninstall scripts finds these and removes them. Since the uninstall script lives in a place the uninstaller deletes, you should probably copy the uninstall script somewhere else before running it:

cd
cp /Library/Receipts/MonoFramework-2.4_7.macos10.novell.universal.pkg/Contents/Resources/uninstallMono.sh .
sudo ./uninstallMono.sh
rm uninstallMono.sh
like image 27
joev Avatar answered Nov 10 '22 14:11

joev