I have installed Mono 1.9 on Ubuntu. This release also contains the first production release for MonoDevelop, version 1.0. Since it was only just released, it is not yet available as a package to be installed through the Synaptic package manager. So you have to do it manually. I ran into a multitude of problems, so I describe what I had to do below. I hope this post can make your life easier.

 

Step 0: Describing the scene

 

The installation was done on Ubuntu Desktop 7.10. There was already an older version of Mono installed, but different Mono versions can be installed side by side.

 

Step 1: Downloading Mono

 

Mono can be downloaded on http://www.go-mono.com/mono-downloads/download.html. There is no Ubuntu or Debian specific package, so I used the download for “other Linuxes”, giving me the file mono-1.9_5-installer.bin.

 

Step 2: Adding missing libraries

 

At the end, the installer does some checking on whether you have the right libraries needed for Mono to run. They are not needed during the installation itself, but for Mono or MonoDevelop. On my fairly out-of-the-box Ubuntu system, I was missing 5.

 

I did the installation first, and then found out about the missing libraries. I recommend you to do it the other way around. This way, if the installer doesn't complain, you know you have everything.

 

  1. libglitz1: check in Synaptic whether the package libglitz1 is installed. It provides the library libglitz.so.1. If not, add it.
  2. libnspr4-dev: check in Synaptic whether the package libnspr4-dev is installed. It provides the libraries libnspr4.so, libplc4.so and libplds4.so. If not, add it.
  3. libgailutil17: check in Synaptic whether the package libgailutil17 is installed. It provides the library libgailutil.so.17. If not, add it. I had a more recent version of this package installed (libgailutil18), but Mono need the version 17. Synaptic could not find this package at first, so I had to add the Debian site as a software source for Synaptic. Instructions on how to add this source is provided on http://packages.debian.org/etch/i386/libgail17/download. Choose a mirror close to you. Once the source was added, the package showed up in Synaptic.

 

Step 3: Installing Mono

 

Make the file downloaded in step 1 executable by executing

 

chmod +x mono-1.9_5-installer.bin

Then launch the installer with root permissions

 

sudo ./mono-1.9_5-installer.bin

I kept the default settings proposed during installation, which installed mono in the folder /opt/mono-1.9/.

 

There are some special remarks (http://mono-project.com/InstallerInstructions) for this installer, especially around problems with the installer not running in GTK graphics mode, but I didn't encounter them.

 

Now that we got so far, let's try to get MonoDevelop going.

 

Step 4: Editing /opt/mono-1.9/bin/monodevelop

 

MonoDevelop was written in C#, so it needs mono to run. The shell script /opt/mono-1.9/bin/monodevelop is used to fire up mono to run MonoDevelop. I had to edit this file in two places to straighten out paths.

 

The variable MD_BIN_PATH on line 56 holds the path to where MonoDevelop is installed. I changed it from

 

MD_BIN_PATH=/usr/lib/monodevelop/bin

to

 

MD_BIN_PATH=/opt/mono-1.9/lib/monodevelop/bin

As of line 90, there are 4 different exec lines to start MonoDevelop with the right parameters. In each of them, I changed

 

/usr/bin/mono

to

 

/opt/mono-1.9/bin/mono

Step 5: Launching MonoDevelop as root

 

When I launch the command

 

/opt/mono-1.9/bin/monodevelop

from the terminal logged in as root, MonoDevelop starts with one warning:

 

WARNING [2008-03-31 20:44:03Z]: Inotify watch limit is too low (8192).
MonoDevelop will switch to managed file watching.
See http://www.monodevelop.com/Inotify_Watches_Limit for more info.

To increase the Inotify watches limit, type

 

echo 16384 > /proc/sys/fs/inotify/max_user_watches

at the terminal prompt before starting MonoDevelop. The more permanent solution is to add the line

 

fs.inotify.max_user_watches=16384

at the end of the /etc/sysctl.conf file. I tried both ways, and they both did the job.

 

Step 6: Launching MonoDevelop as a normal user

 

When I launch the command

 

/opt/mono-1.9/bin/monodevelop

from the terminal logged in as a regular user, it doesn't work. There were 3 things that I had to do before it worked.

 

Step 7: modifying the .bashrc script

 

During install, mono has added 4 lines to the .bashrc script of the root user, because I installed mono under the root account to have the necessary access rights on folders. These lines are

 

export PATH="/opt/mono-1.9/bin:$PATH"
export PKG_CONFIG_PATH="/opt/mono-1.9/lib/pkgconfig:$PKG_CONFIG_PATH"
export MANPATH="/opt/mono-1.9/share/man:$MANPATH"
export LD_LIBRARY_PATH="/opt/mono-1.9/lib:$LD_LIBRARY_PATH"

The same lines were added to the root's .profile file as well.

 

Now a small warning, because this has caused me a lot of headaches. I don't work directly on my Linux computer, but access it from a Windows computer using NoMachine tools. See my other post about this tool. I don't know if it has anything to do with what I will describe next, but I just give it as a background.

 

I copied the four lines above from the .bashrc file from the root folder and added them to my own .bashrc file. Next time I logged in (through remote desktop), I got an Xwindows initialization error and could no longer log in to my Linux machine. I had to use SSH to get in console mode and use a text editor (Nano in my case) to remove the 4 lines from the .bashrc file to restore my remote desktop access. Not a clue what was wrong.

 

I left it to be, shut down all computers, and went to sleep. Next day, I did added these 4 lines again, and now it works! No login problems anymore. No idea what I did wrong. Probably something due to all the trial and error I did, which I can never reproduce again.

 

Step 8: .config/MonoDevelop folder

 

Trying again to launch MonoDevelop under my own account gave me the following error.

 

ERROR [2008-03-30 00:32:06Z]: Add-in error (MonoDevelop.Core.Gui,1.0.0): Add-in could not be loaded: The required addin 'MonoDevelop.Core,1.0.0' is not installed.
Mono.Addins.MissingDependencyException: The required addin 'MonoDevelop.Core,1.0.0' is not installed.
at Mono.Addins.AddinSessionService.ResolveLoadDependencies (System.Collections.ArrayList addins, System.Collections.Stack depCheck, System.String id, Boolean optional) [0x00000]
at Mono.Addins.AddinSessionService.ResolveLoadDependencies (System.Collections.ArrayList addins, System.Collections.Stack depCheck, System.String id, Boolean optional) [0x00000]

This problem has already been reported many times on the web, and the fix is typically to just erase everything in that folder, so I did. MonoDevelop uses this folder to store its config.

 

Step 9: undefined symbol: gzopen64

 

Ok, trying again to launch MonoDevelop under my own account. Now I get the following error:

 

monodevelop: symbol lookup error: /usr/lib/libxml2.so.2: undefined symbol: gzopen64

To fix this, replace the file libz.so.1.2.1 in /opt/mono-1.9/lib/ with libz.so.1.2.3.3 from /usr/lib. Credits for this solution go to D. Dobrev.

 

Step 10: The moment you have all been waiting for

 

In a console window, I tried again

 

/opt/mono-1.9/bin/monodevelop

and MonoDevelop launched. A moment of joy.

Currently rated 4.4 by 8 people

  • Currently 4.375001/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Related posts

Comments

September 16. 2008 07:49

pingback

Pingback from gttol.com

在Ubuntu8.0.4上部署Mono开发环境 - BLOG - Fighting Man

gttol.com

Add comment


(Will show your Gravatar icon)  

  Country flag





Live preview

November 22. 2008 02:33