一、安裝依賴關(guān)系包
yum install gcc bison pkgconfig glib2-devel gettext make gcc-c++ libstdc++-devel libgdiplus-devel
二、下載源碼并解壓
#下載地址在http://ftp.novell.com/pub/mono/sources/mono/
#我下載的是2.10.2/p>
p>cd /usr/local/src
wget -c http://ftp.novell.com/pub/mono/sources/mono/mono-2.10.2.tar.bz2
tar xf mono-2.10.2.tar.bz2
cd mono-2.10.2
三、編譯安裝
./configure --prefix=/usr/local/mono
make
make install
四、為使用mono的用戶增加環(huán)境變量
#在這個(gè)用戶的~/.bash_profile時(shí)增加
export PKG_CONFIG_PATH=/usr/local/mono/lib/pkgconfig:
export PATH=/usr/local/mono/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
#重新加載一下
source ~/.bash_profile
五、測試
/usr/local/mono/bin/mono-test-install
Active Mono: /usr/local/mono/bin/mono/p>
p>Your have a working System.Drawing setup
Your file system watcher is: System.IO.InotifyWatcher
如果沒有做第四步會(huì)發(fā)現(xiàn)報(bào)下邊這個(gè)錯(cuò)誤:
/usr/local/mono/bin/mono-test-install
Active Mono:
Warning: pkg-config could not find mono installed on this system
No dotnet pkgconfig found, Windows.Forms, System.Drawing and others will not work