I've been trying to remove mono completely from my Ubuntu 12.04 installation.
I have seen a few other posts with:
sudo apt-get purge mono-runtime
sudo apt-get purge mono-complete
sudo apt-get purge libmono* libgdiplus cli-common libglitz-glx1 libglitz1I've run all those and done sudo apt-get update but when I type mono -V it's still there.
I'm trying to remove it completely to re install again with the latest beta build Mono JIT compiler version 2.10.8 (tarball Wed Oct 2 16:46:11 CEST 2013) Is the version I have currently but NEED the latest beta build.
3 Answers
sudo apt remove --purge --auto-remove mono-runtimeThis will then completely remove mono from your system to correct the issue.
Ok simply run sudo rm -rf usr/lib/mono /usr/local/bin/mono /usr/local/etc/mono /usr/local/lib/mono in terminal.
This is how I did on my 16.04
Before someone starts raging and telling me there was a better, faster and more concise way to do that: Yes, I know. I took the "long way" to analyze the results of each step and triple check what I was doing.
- be su:
sudo -i - list all the packages from the mono repository (into file pkg1):
grep ^Package: /var/lib/apt/lists/download.mono-project.com*_Packages > pkg1 - extract just the package names (into file pkg2):
sed -e 's/^.*Package: //' pkg1 > pkg2 - (optional but I wanted to do that anyway) remove duplicate package names from different architectures and put definitive list of packages to search for and remove in pkg3:
awk '!seen[$0]++' pkg2 > pkg3 - (optional, for check) count the lines in the files (one line = one package) to see what happened:
wc -l pkg1andwc -l pkg2andwc -l pkg3 - remove packages listed in pkg3:
apt purge $(cat pkg3) - cleanup and exit su:
rm pkg1 pkg2 pkg3andlogout