Set Mono environment variables in CentOS
Set Mono environment variables in CentOS
GitHub has a one-click Mono installation script. For more information, see https://github.com/nathanb/iws-snippets/tree/master/mono-install-scripts/fedora.
1. Install the latest Mono environment Mono-2.11
Mkdir mono-2.11
Cd mono-2.11
Wget -- no-check-certificate https://github.com/nathanb/iws-snippets/tree/master/mono-install-scripts/fedora/install_mono-2.11.sh
Chmod 755 install_mono-2.11.sh
/Install_mono-2.11.sh
2. Set Mono environment variables on CentOS
The installation script installs Mono to/opt/mono-2.11/. 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 ".
[Root @ SNDA-192-168-15-161 ~] # Vi/etc/profile
Add the following two lines of code to the end of the file:
PATH =/opt/mono-2.11/bin: $ PATH
Export PATH
If the modification takes effect immediately, run the following code:
[Root @ SNDA-192-168-15-161 ~] # Source/etc/profile
Method 2: Create a Mono configuration under the/etc/profile. d/directory.
Create a new mono. sh
Initialize environment variables in this file
Export PATH = $ PATH:/opt/mono-2.11/bin
If the modification takes effect immediately, run the following code:
[Root @ SNDA-192-168-15-161 profile. d] # source mono. sh
Now you can directly execute the Mono command.
[Root @ SNDA-192-168-15-161 profile. d] # mono-V
Mono JIT compiler version 2.11.3 (tarball Thu Oct 11 07:46:58 CST 2012)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: _ thread
SIGSEGV: altstack
Specifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: encoded ded Boehm (with typed GC and Parallel Mark)
Deploying. NET, Mono and DNX in Ubuntu 15.04 and CentOS 7
Configure ASP. NET (Apache + Mono) in Linux (Ubuntu/openSUSE/CentOS)
Configure the Linux (Apache) + Mono to run asp.net
How to upgrade Mono
Idea about running ASP. NET 4 website in Mono 3.0
Install Mono and Jexus on Ubuntu to build the. NET Runtime Environment