Preface after trying to install mono on the Internet, this installation process went through about two weeks and tried all the installation methods described by various versions and blogs. You can try different versions of mono by installing the following content. And standard installation in informal environments. 1. install the required Library yum-yinstallwgetglib2-devellibtifflibtiff-de
Preface
After trying to install mono on the Internet, this installation process went through about two weeks and tried various versions and all the installation methods described by the blogs. You can try different versions of mono by installing the following content. And standard installation in informal environments.
1. install the required Library
yum -y install wget glib2-devel libtiff libtiff-devel libjpeg libjpeg-devel giflib giflib-devel libpng libpng-devel libX11 libX11-devel freetype freetype-devel fontconfig fontconfig-devel libexif libexif-devel gcc-c++ gettext unzip zip bzip2 bzip2-devel curl-devel gtk2-devel boost-devel
2. add an rpm source
rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"yum-config-manager --add-repo http://jenkins.mono-project.com/repo/centos/
3. search for available versions
yum search mono-snapshot
4. select to install the latest snapshot.
yum -y install mono-snapshot-latest
Ps: If you want to install a snapshot of a certain version, the command is
yum -y install mono-snapshot-XXXXXXXXX
5. View available Mono snapshots
mono-snapshot
The result is as follows:
This script will help you to set up your environment to use asnapshot package of Mono. To use it, run: . mono-snapshot APP/VERYou have the following possible combinations of APP/VER: mono/20150520032320Calling APP without specifying VER will load the latest version
6. execute the specified snapshot
Mono-snapshot mono or mono-snapshot mono/XXXXXXXXX
Display result:
[Mono-20150520032320] [root @ localhost ~] # Mono-20150520032320 indicates the snapshot used by mono
7. check whether Mono is successfully installed.
mono --version
Display result:
Mono JIT compiler version 4.1.0 (tarball Tue May 19 23:45:50 EDT 2015)Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com TLS: __thread SIGSEGV: altstack Notifications: epoll Architecture: amd64 Disabled: none Misc: softdebug LLVM: supported, not enabled. GC: sgen
8. set Mono environment variables on CentOS
Use the find/-name 'libmonoposixhelper. so' command to find the installation address of the version;
find / -name 'libMonoPosixHelper.so'/opt/mono-20150520032320/lib/libMonoPosixHelper.so
Write down/opt/mono-20150520032320 (used below)
If multiple versions are installed, multiple records are generated.
The following content mainly refer to the article (http://www.cnblogs.com/shanyou/archive/2012/10/11/2720597.html)
The installation script installs Mono/Opt/mono-20150520032320/, you need to add the Mono directory to the system $ PATH variable
Method 1: add a variable to the/etc/profile file [effective for all users (permanent )]
Use VI to add a variable to the/etc/profile File. this variable will be valid for all users in Linux and will be "permanent ".
vi /etc/profile
Add the following two lines of code to the end of the file:
PATH=/opt/mono-20150520032320/bin:$PATH export PATH
The modification takes effect. run the following code (otherwise restart reboot)
source /etc/profile
Method 2: Create a Mono configuration under the/etc/profile. d/directory.
cd /etc/profile.d/
Create a new mono. sh
vi mono.sh
Write the following content into this file:
export PATH=$PATH:/opt/mono-20150520032320/bin
The "mono-20150520032320" in the path is shown above. if you need to configure an updated version, you can configure the path.
The modification takes effect. you need to execute the following code:
source mono.sh
Now you can directly execute the Mono command.
mono -VMono JIT compiler version 4.1.0 (tarball Tue May 19 23:45:50 EDT 2015)Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com TLS: __thread SIGSEGV: altstack Notifications: epoll Architecture: amd64 Disabled: none Misc: softdebug LLVM: supported, not enabled. GC: sgen
The execution results are consistent. Mono installation is complete.