Skip to content

Instantly share code, notes, and snippets.

@txdv
Last active August 29, 2015 14:05
Show Gist options
  • Save txdv/7d31e4e7d2e89f421515 to your computer and use it in GitHub Desktop.
Save txdv/7d31e4e7d2e89f421515 to your computer and use it in GitHub Desktop.
Install script for mono for debian based distributions.

Install latest and newest mono!

So you want to install mono on Debian/Ubuntu?

But doing all the steps on your own is hard?

Just run the scripts and everything will be done for you!

./install-mono.sh
./install-monodevelop.sh
./install-path.sh

The first script installs mono, the second one monodevelop and the third one installs the path variables to .bashrc so you can access the newesst mono and monodevelop from the command line.

If you are on a server, you probably don't want to install monodevelop, so leave the command just out.

Remember, that this will let you access the newest from the terminal, not command run (like ALT+F2).

You have to open the command line and uses the mono or monodevelop commands.

#!/bin/bash
function add_export {
if [[ -d $1/lib ]]; then
export DYLD_LIBRARY_PATH=$1/lib:$DYLD_LIBRARY_PATH
export LD_LIBRARY_PATH=$1/lib:$LD_LIBRARY_PATH
fi
if [[ -d $1/include ]]; then
export C_INCLUDE_PATH=$1/include:$C_INCLUDE_PATH
fi
if [[ -d $1/share/aclocal ]]; then
export ACLOCAL_PATH=$1/share/aclocal:$ACLOCAL_PATH
fi
if [[ -d $1/lib/pkgconfig ]]; then
export PKG_CONFIG_PATH=$1/lib/pkgconfig:$PKG_CONFIG_PATH
fi
if [[ -d $1/bin ]]; then
export PATH=$1/bin:$PATH
fi
}
add_export $@
#!/bin/bash
PREFIX=$@
if [ -z $PREFIX ]; then
PREFIX=/home/$USER/.mono/3.6.0
fi
./install-mono.sh $PREFIX
./install-monodevelop.sh $PREFIX
./install-path $PREFIX
#!/bin/bash
PREFIX=$@
if [ -z $PREFIX ]; then
PREFIX=/home/$USER/.mono/3.6.0
fi
sudo apt-get install git autoconf libtool automake build-essential mono-devel
if [ ! -d "mono" ]; then
git clone http://github.com/mono/mono
fi
cd mono
git checkout mono-3.6.0.39
./autogen.sh --prefix=$PREFIX
make
make install
#!/bin/bash
PREFIX=$@
if [ -z $PREFIX ]; then
PREFIX=/home/$USER/.mono/3.6.0
fi
. add_export $PREFIX
if [ ! -d "gtk-sharp" ]; then
git clone https://github.com/mono/gtk-sharp
fi
sudo apt-get install libglib2.0-dev libpango1.0-dev libatk1.0-dev libgtk2.0-dev libglade2-dev
cd gtk-sharp
git checkout 2.12.22
./bootstrap-2.12 --prefix=$PREFIX
make
make install
cd ..
if [ ! -d "gnome-sharp" ]; then
git clone https://github.com/mono/gnome-sharp.git
fi
sudo apt-get install libgnomecanvas2-dev libgnome2-dev libgnomeui-dev
cd gnome-sharp
./bootstrap-2.24 --prefix=$PREFIX
make
make install
cd ..
if [ ! -d "monodevelop" ]; then
git clone https://github.com/mono/monodevelop.git
fi
# satisfy nuget, it will be called in the build script of monodevelop
mozroots --import --sync
cd monodevelop
git checkout monodevelop-5.3.0.423
./configure --prefix=$PREFIX
make
make install
#!/bin/bash
PREFIX=$@
if [ -z $PREFIX ]; then
PREFIX=/home/$USER/.mono/3.6.0
fi
cp ./add_export ~/.add_export
echo "source ~/.add_export $PREFIX" >> ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment