Disclaimer: I offer this answer since I believe you should have control over what packages are on your system--not to flame the mono-hate flame war. Also this question is heavily edited since my first post.
To remove mono completely all you have to do is remove the base mono libraries, and all files that depend on those libraries will also be removed. The exact set of packages that need to be removed vary depending on which version of Ubuntu you are using. I believe you should be able to remove most of mono with the following command (Update: I've updated the command to better ensure everything is removed.):
$ sudo apt-get purge libmono* cli-common mono-runtime
The command should list all of the packages that will be removed--including applications that depend on mono-- and ask you to confirm their removal. You should review the list carefully before accepting the changes and make sure you won't be removing something you need. You may want to follow that up with:
$ sudo apt-get autoremove
If you are more comfortable with GUI tools, you can also do this in Synaptic:
- Change to the "installed" filter.
- Use the quick search box and search for "libmono."
- Select all of the packages that appear in the results.
- Mark them for complete removal.
- Repeat steps 2-4 for the other packages in the command above.
- Press apply.
Keeping Mono Off of Your System
While there used to be a package called mononono that would prevent mono from being installed on the system, I do not believe this package works well with recent versions of Ubuntu. If you are truly concerned with keeping mono off of your system, I would simply look carefully at the details of software installs you do and ensure that you do not see it pulling in mono libraries.
One more automatic method would be to using apt-preferences. Putting the following in
/etc/apt/preferences or in a file inside
/etc/apt/preferences.d/ should provide relatively good defense against installing mono on your system:
Package: cli-common mono-runtime
Pin: version *
For more information about how this works, see
man apt_preferences. The short version is that negative priorities prevent that version of the package from being installed.
If you are very concerned about non-free software, you may find the vrms package of interest. It lists non-free packages on the system. It will not list mono packages since patent issues are orthogonal to the software being free, at least according to some definitions of "free." Also, if you were to list all of the packages that have potential patent issues, you'd have to list a whole lot of packages.