Installing MonoGame 3.6 on Linux

As few of you might have noticed Xamarin folks have stopped updating the per distro packages for MonoDevelop so you are all probably stuck with MonoDevelop 5.9, while MonoGame requires MonoDevelop 6 for the plugin. MonoGame also won’t work with the flatpak version (at least the 3.6 won’t) because it has it’s own content builder which is not sandboxed.

Since many of you will have problems installing MonoGame I decided to write down these installation instructions, they are split into 3 steps and if you are running Arch Linux based distro, you can skip steps 1 and 2 since Arch Linux already provides the newest monodevleop version.

1. Installing the newest possible versions official versions of mono and MonoDevelop

You can find the newest possible versions of both of those from: http://www.monodevelop.com/download/linux/, you just need to follow the Legacy instructions for your distribution.

Do note that the installation page forgets to tell you that to install MonoDevelop you need to install monodevelop package.

2. Installing MonoDevelop 6

I took the time to package the newest possible version of MonoDevelop in a way that can be installed on any Linux systems, the package source can be found at: https://github.com/cra0zy/monodevelop-run-installer

To install MonoDevelop 6 simply run the following commands (do note that this will not replace your system MonoDevelop, it will instead add a new “MonoDevelop Stable” launcher):

wget https://github.com/cra0zy/monodevelop-run-installer/releases/download/6.2.0.1778-1/monodevelop-6.2.0.1778-1.run
chmod +x monodevelop-6.2.0.1778-1.run
sudo ./monodevelop-6.2.0.1778-1.run

2.5. Just open MonoDevelop Stable so it creates the necessary files as the current user.

3. Installing MonoGame

Simply download and run the installer:

wget http://www.monogame.net/releases/v3.6/monogame-sdk.run
chmod +x monogame-sdk.run
sudo ./monogame-sdk.run

The installer will automatically check and warn you if you are missing any dependency.

4 Likes

Hi there. I just finished installing monodevelop and monogame.
$ uname -a
Linux humunculus 4.8.0-39-generic #42-Ubuntu SMP Mon Feb 20 11:47:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

I had a weird problem with a line like

FSC: error FS0193: The module/namespace 'Gdk' from compilation unit 'gdk-sharp' did not contain the namespace, module or type 'EventClient'

The solution was to download Gtk-sharp sources from
http://www.mono-project.com/docs/gui/gtksharp/

in particular the MONO DOWNLOAD link
https://download.mono-project.com/sources/gtk-sharp212/

then compile that, configure, make, make install

I had to install the libgtk2.0-dev and libglade-dev packages.

Then once gtk-sharp2 updated I was able to finish installing and executing everything right away.

Thanks for your work!

What version of Ubuntu are you using?

I’ve tested the MonoDevelop run installer with Ubuntu 16.04.

I used these instructions on Elementary OS (0.4 Loki). I think they installed correctly, but I could never see the MonoGame templates in MonoDevelop. :frowning:

Did you launch “MonoDevelop” or “MonoDevelop Stable”, the second one is the correct one to launch. I probably should have mentioned that in the instructions.

Yeah, I actually tried both, and I couldn’t see the templates in either.

When you run monogame-sdk.run do you get [Found] for MonoDevelop 6?

Yes. Here’s what I get:

Also, I tried running these instructions on a fresh Lubuntu virtual machine, and got these errors when I tried to launch monodevelop-stable:

ERROR [2017-04-01 13:41:21Z]: Failed to redirect output to log file
System.UnauthorizedAccessException: Access to the path "/home/josh/.cache/MonoDevelop-6.0/Logs" is denied.
  at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00070] in <f712f98eb8e445c8918edaf595bbe465>:0 
  at System.IO.Directory.CreateDirectory (System.String path) [0x000a4] in <f712f98eb8e445c8918edaf595bbe465>:0 
  at MonoDevelop.Core.LoggingService.RedirectOutputToFileUnix () [0x00012] in <ecded49933f54915a63b93f09319c157>:0 
  at MonoDevelop.Core.LoggingService.RedirectOutputToLogFile () [0x00019] in <ecded49933f54915a63b93f09319c157>:0 
INFO [2017-04-01 13:41:22Z]: Starting MonoDevelop 6.2
INFO [2017-04-01 13:41:22Z]: Running on Mono 4.8.0 (Stable 4.8.0.520/8f6d0f6 Wed Mar 15 16:18:35 UTC 2017) (64-bit)
INFO [2017-04-01 13:41:22Z]: Operating System: Linux
Linux lubvm 4.8.0-22-generic #24-Ubuntu SMP Sat Oct 8 09:15:00 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
INFO [2017-04-01 13:41:22Z]: Using GTK+ 2.24.30
System.UnauthorizedAccessException: Access to the path "/home/josh/.cache/MonoDevelop-6.0/addin-db-002/hosts/MonoDevelop.addins" is denied.
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0025f] in <f712f98eb8e445c8918edaf595bbe465>:0 
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.String msgPath, System.Boolean bFromProxy, System.Boolean useLongPath, System.Boolean checkHost) [0x00000] in <f712f98eb8e445c8918edaf595bbe465>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
  at System.IO.StreamWriter.CreateFile (System.String path, System.Boolean append, System.Boolean checkHost) [0x00022] in <f712f98eb8e445c8918edaf595bbe465>:0 
  at System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize, System.Boolean checkHost) [0x00061] in <f712f98eb8e445c8918edaf595bbe465>:0 
  at System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize) [0x00000] in <f712f98eb8e445c8918edaf595bbe465>:0 
  at System.IO.StreamWriter..ctor (System.String path) [0x00008] in <f712f98eb8e445c8918edaf595bbe465>:0 
  at (wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor (string)
  at Mono.Addins.AddinRegistry.CreateHostAddinsFile (System.String hostFile) [0x00142] in <bd16ebf525e04bea9f1e0907860e61de>:0 
  at Mono.Addins.AddinEngine.Initialize (System.Reflection.Assembly startupAsm, System.String configDir, System.String addinsDir, System.String databaseDir) [0x0009f] in <bd16ebf525e04bea9f1e0907860e61de>:0 
  at Mono.Addins.AddinManager.Initialize (System.String configDir, System.String addinsDir, System.String databaseDir) [0x0001e] in <bd16ebf525e04bea9f1e0907860e61de>:0 
  at MonoDevelop.Core.Runtime.Initialize (System.Boolean updateAddinRegistry) [0x00110] in <ecded49933f54915a63b93f09319c157>:0 
INFO [2017-04-01 13:41:23Z]: GTK: Using Gtk theme from /usr/share/themes/Lubuntu-default
Starting MonoDevelop
FATAL ERROR [2017-04-01 13:41:23Z]: MonoDevelop failed to start. Some of the assemblies required to run MonoDevelop (for example gtk-sharp)may not be properly installed in the GAC.
System.InvalidOperationException: Add-in engine not initialized.
  at Mono.Addins.AddinEngine.CheckInitialized () [0x0000c] in <bd16ebf525e04bea9f1e0907860e61de>:0 
  at Mono.Addins.AddinManager.GetExtensionObjects (System.String path) [0x00006] in <bd16ebf525e04bea9f1e0907860e61de>:0 
  at MonoDevelop.Ide.DesktopService.Initialize () [0x00010] in <8e60aa0560c44ca69e4f561f2f540933>:0 
  at MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions options) [0x00332] in <8e60aa0560c44ca69e4f561f2f540933>:0 
  at MonoDevelop.Ide.IdeStartup.Main (System.String[] args, MonoDevelop.Ide.Extensions.IdeCustomizer customizer) [0x000ab] in <8e60aa0560c44ca69e4f561f2f540933>:0

In MonoDevelop, go Tools > Addins, check if you have Game Development > MonoGame Addin, maybe the addin got disabled for you for some reason. If it doesn’t exist, install it from Gallery tab.

Well, now I’m having trouble just getting monodevelop-stable to launch. I’m getting the errors mentioned above.

Sorry, did not see that while I was writing my comment… anyway System.UnauthorizedAccessException for both the config and log folders is what seems to be causing the crash… not sure why MD can’t get access to those folders… you might want to check the permissions on the folders manually.

So, I ran these two things (on the virtual machine):

sudo chown -R josh ~
sudo chmod -R 777 ~

But I still didn’t have any luck. :frowning: Any other suggestions?

If you are not paranoid about something like teamviewer I can try to fix it for you…

Can I DM you somehow?

For some reason, I hit a weird limit on replies in the DM. But no, it didn’t work. :frowning: I did sudo apt-get update and sudo apt-get install monodevelop, but monodevelop-stable still won’t launch.

Well turns out there is a bug with MG installer because it’s launching mdtool with root privileges… solution was to delete .config/MonoDevelop-6.0 and .cache/MonoDevelop-6.0 folders.

Hi, I am trying to follow along with this guide but I cannot launch Monodevelop Stable after installation. When I try to launch the program there is no response; nothing opens, no error messages show, absolutely nothing. If I try to run the monodevelop-stable file from terminal I get the following output:

Starting MonoDevelop
FATAL ERROR [2017-05-03 12:11:59Z]: MonoDevelop failed to start. Some of the assemblies required to run MonoDevelop (for example gtk-sharp)may not be properly installed in the GAC.
System.InvalidOperationException: Add-in engine not initialized.
  at Mono.Addins.AddinEngine.CheckInitialized () [0x0000c] in <bd16ebf525e04bea9f1e0907860e61de>:0 
  at Mono.Addins.AddinManager.GetExtensionObjects (System.String path) [0x00006] in <bd16ebf525e04bea9f1e0907860e61de>:0 
  at MonoDevelop.Ide.DesktopService.Initialize () [0x00010] in <8e60aa0560c44ca69e4f561f2f540933>:0 
  at MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions options) [0x00332] in <8e60aa0560c44ca69e4f561f2f540933>:0 
  at MonoDevelop.Ide.IdeStartup.Main (System.String[] args, MonoDevelop.Ide.Extensions.IdeCustomizer customizer) [0x000ab] in <8e60aa0560c44ca69e4f561f2f540933>:0 

I definitely have gtk-sharp installed, but I don’t know what the Add-in engine it mentions is. Can anybody help me get around this issue? Not much of a point in having monogame if I can’t even start an IDE to use it with.

Thanks

What Linux distro and version are you running?