How to install Mono or dotNET45 on Linux – Tutorial

How to install Mono or dotNET45 on Linux – Tutorial

Updated: May 20, 2019

Linux. WINE. Interesting use case. As it happens, I was playing with WINE, trying to install some
Windows software. Turns out, the particular program is available natively, so no biggie, but
occasionally, I am trying this framework, to see if it’s made progress in becoming simpler and
easier.

On this particular rainy day, I was not having success with Mono, or dotNET if you will. The
application couldn’t run, because there was Mono missing on my Linux box, but getting it configured
correctly was far from trivial. Hence this tutorial. Someone somewhere out there may have an obscure
use case, and this little guide shall come handy one day. Or not. After me.

Error that be

Long story short, when you run
wine “program”, you get this:

003a:err:mscoree:CLRRuntimeInfo_GetRuntimeHost Wine Mono is not installed

Self evident, no? Well, the solution is to install the complete Mono framework, which is done by
specifying the mono-complete meta package. I tested this on an Ubuntu-based system, so don’t hate me if
the naming convention is different in your distro:

sudo apt-get install mono-complete

Alas, this did not help.

Solution 1: Official Mono installer

You can grab the package from the
official WINE website, and then install it using
the Add/Remove functionality via
wine uninstaller as I’ve shown you a few weeks back. Select Add,
select the Mono MSI package, and that should be all.

Installation via GUI

In my case, I did make progress, but not enough. A new error message:

002f:err:mscoree:LoadLibraryShim error reading registry key for installroot

Solution 2: Winetricks

I decided to go old school and fall back to this neat little
wrapper script, which you can use to install tons of common Windows
applications, libraries and utilities, and hopefully, not have to deal with any fancy errors. I
installed the script from the repos, and then installed dotNET 4.5 using it.

sudo apt-get install winetricks

winetricks dotnet45

The UI launched, and I started clicking buttons. Progress was made. Errors came up, but the wizard
did not crash. The errors are far from helpful, and unless they block the installation, they should not
be shown.

Winetricks, installation in progress

It was a little protracted, and several Microsoft wizards popped up, asking me to accept EULA and
such. But in the end, I had dotNET correctly installed – and more importantly – the Windows application
was able to detect the framework, and I was able to complete the WINE installation.

If you’re wondering, my test program was KeePass, which is also available through the repos. But as
it happens, the Windows versions comes with a nicer icon and better system area integration, at least
in Plasma, but the UI itself is more visually pleasing natively, possibly due to
font DPI and whatnot. So overall, I was rather happy, as
usually, I had little luck with WINE attempts in the past.

Windows application installed

Conclusion

Here we go. Success! Now, this does not mean we’re now in the golden age of Windows-Linux
compatibility. Not at all. But every little bit of progress we make is good and useful, especially if
it helps people gain more freedom in their software choice. Native solutions are always the best
option, but if there ain’t one, you can dabble in WINE.

The big issue with this framework is that there’s no golden formula. You can’t just say, do these
four steps and all your applications will install and run well. Nope. There’s a fair amount of chance
and luck, and some of the setups can be quite convoluted. I guess this one ranges midway on that scale.
But we’ve accomplished our task. You wanted Mono, you got Mono. Happy Linuxing. I mean Winduxing.

Cheers.

Source