How to install mono 3 on debian or ubuntu

At the time of writing 3.8.0 was the newest version for Mono that I could find. If a newer version of Mono has come out by now, you can probably find it here.

Installation guide

Make might take 30-60 minutes, make-install should be fast

apt-get update
apt-get install -y --force-yes gcc libtool bison pkg-config libglib2.0-dev gettext make bzip2 g++ build-essential

mkdir -p /var/mono-install
cd /var/mono-install

tar xvjf mono-3.*.tar.bz2
cd mono-3.*

./configure --prefix=/opt/mono3
make install

rm /usr/bin/mono
rm /usr/bin/gmcs
rm /usr/bin/mcs
rm /usr/bin/smcs
rm /usr/bin/dmcs
ln -s /opt/mono3/bin/mono /usr/bin/mono
ln -s /opt/mono3/bin/gmcs /usr/bin/gmcs
ln -s /opt/mono3/bin/mcs /usr/bin/mcs
ln -s /opt/mono3/bin/smcs /usr/bin/smcs
ln -s /opt/mono3/bin/dmcs /usr/bin/dmcs

rm -R /var/mono-install

Installing OpenVPN v2.3+ on debian


apt-get update
apt-get -y --force-yes install openvpn udev easy-rsa
mkdir -p /etc/openvpn/easy-rsa/2.0
cp -r /usr/share/easy-rsa /etc/openvpn/easy-rsa/2.0
cd /etc/openvpn/easy-rsa/2.0
mv easy-rsa/* /etc/openvpn/easy-rsa/2.0
rmdir easy-rsa
chmod u+x vars
chmod u+x clean-all
chmod u+x build-ca
source ./vars

./build-key-server $KEYSERVERNAME

./build-key client

cp /etc/openvpn/easy-rsa/2.0/keys/ca.crt /etc/openvpn
cp /etc/openvpn/easy-rsa/2.0/keys/ca.key /etc/openvpn
cp /etc/openvpn/easy-rsa/2.0/keys/dh2048.pem /etc/openvpn
cp /etc/openvpn/easy-rsa/2.0/keys/$KEYSERVERNAME.crt /etc/openvpn
cp /etc/openvpn/easy-rsa/2.0/keys/$KEYSERVERNAME.key /etc/openvpn

gunzip -d /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz
cp /usr/share/doc/openvpn/examples/sample-config-files/server.conf /etc/openvpn
cp /usr/share/doc/openvpn/examples/sample-config-files/client.conf ~/
cp /usr/share/doc/openvpn/examples/sample-config-files/client.conf ~/

vim ~/client.conf
vim /etc/openvpn/server.conf
/etc/init.d/openvpn restart

Install VMWare on Ubuntu 14 with kernel 3.13.0

Make sure you’re installing the latest vmware version, because even slightly older versions probably don’t support 3.13.0 kernels.

apt-get install build-essential linux-headers-$(uname -r) open-vm-dkms
ln -s /usr/src/linux-headers-$(uname -r)/include/generated/uapi/linux/version.h /usr/src/linux-headers-$(uname -r)/include/linux/version.h
vmware-modconfig --console --install-all

You may have to cd into vmware-modconfig‘s containing directory before executing that last command, but I don’t remember where it is.

Start VMWare Services

/etc/init.d/vmware start

Start VMWare Workstation


Start VMWare player


Install vsftpd version 3 to fix writable root error OOPS 500

Below information is taken from Stack Overflow

Install vsftpd v3 via repo

echo "deb jessie main contrib non-free" >> /etc/apt/sources.list
apt-get update
apt-get install -y --force-yes vsftpd

If the post-setup script fails, delete it so it doesn’t keep bothering you

cd /var/lib/dpkg/info && rm vsftpd.postinst

Allow writable chroot

echo "allow_writeable_chroot=YES" >> /etc/vsftpd.conf
service vsftpd restart

Or via package (no instructions)

Other config I use for first-time setup


Trusty Tahr apache2, php5-fpm and event MPM

apt-get install -y --force-yes apache2 php5-fpm  libapache2-mod-fcgid php5-cgi
sed -i "s/listen =.*/listen =" /etc/php5/fpm/pool.d/www.conf
a2dismod mpm_prefork
a2enmod mpm_event

echo -e "<Directory /var/www>\n\
AddHandler fcgid-script .php\n\
FCGIWrapper /usr/lib/cgi-bin/php5 .php\n\
Options +ExecCGI\n\
# If you have Aliases provide php support for them (Here we provide php support for scripts in /usr/share's subdirectories)\n\
Alias /aptitude /usr/share/doc/aptitude/html/en\n\
Alias /apt /usr/share/doc/apt-doc\n\
<Directory /usr/share>\n\
AddHandler fcgid-script .php\n\
FCGIWrapper /usr/lib/cgi-bin/php5 .php\n\
Options ExecCGI FollowSymlinks Indexes\n\
> /etc/apache2/conf-available/eventphp.conf

a2enconf eventphp
service apache2 restart

Make sure libapache2-mod-php5 is NOT installed

phpinfo file for testing:

echo "<?php phpinfo();" >> /var/www/html/info.php


Show MPM module currently used:

apachectl -V | grep -i mpm

View the available mods

ls /etc/apache2/mods-available/mpm*

Edit the event MPM config:

vim /etc/apache2/mods-available/mpm_event.conf

Configuring phpmyadmin

vim vim /etc/apache2/conf-enabled/phpmyadmin.conf

change Options FollowSymLinks to Options +FollowSymLinks +ExecCGI

Reset mysql password

/etc/init.d/mysql stop
mysqld --skip-grant-tables &
mysql -u root
UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root';
/etc/init.d/mysql stop
/etc/init.d/mysql start

Linux NTP synchronize time (Europe)

The following commands will install the required software, and then find the best server to synchronize with.

apt-get install -y --force-yes ntp ntpdate
/etc/init.d/ntp stop
ntpdate -u
ntpdate -u
ntpdate -u
/etc/init.d/ntp start
ntpq -p

Example output:

root@debian7:~# ntpdate -u
14 May 11:11:13 ntpdate[37185]: step time server offset 200343.474928 sec
root@debian7:~# ntpdate -u
14 May 11:11:23 ntpdate[37238]: adjust time server offset 0.002920 sec
root@debian7:~# ntpdate -u
14 May 11:11:36 ntpdate[37239]: adjust time server offset -0.001120 sec
root@debian7:~# /etc/init.d/ntp start
[ ok ] Starting NTP server: ntpd.
root@debian7:~# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================    2 u    1   64    1    9.807   -3.671   0.391    3 u    -   64    1   10.671    4.814   0.439    3 u    1   64    1   11.161   -2.069   0.000    2 u    -   64    1   10.258   -2.359   0.000