CentOS設定Mono環境變數

來源:互聯網
上載者:User

GitHub上有直接通過指令碼一鍵安裝Mono的指令碼,具體參見 https://github.com/nathanb/iws-snippets/tree/master/mono-install-scripts/fedora。

1、安裝Mono的最新環境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、在CentOS上設定Mono環境變數

安裝指令碼將Mono安裝到了/opt/mono-2.11/,需要將Mono的目錄加入系統$PATH變數

方法一: 在/etc/profile檔案中添加變數【對所有使用者生效(永久的)】
用VI在檔案/etc/profile檔案中增加變數,該變數將會對Linux下所有使用者有效,並且是“永久的”。

[root@SNDA-192-168-15-161 ~]# vi /etc/profile
在檔案末尾加上如下兩行代碼
PATH=/opt/mono-2.11/bin:$PATHexport PATH

要是剛才的修改馬上生效,需要執行以下代碼

[root@SNDA-192-168-15-161 ~]# source /etc/profile

方法二 :在/etc/profile.d/目錄下建立一個Mono的配置

建立一個新的mono.sh

在這個檔案內初始化環境變數

export PATH=$PATH:/opt/mono-2.11/bin

要是剛才的修改馬上生效,需要執行以下代碼

[root@SNDA-192-168-15-161 profile.d]# source mono.sh

現在可以直接執行Mono 的命令了

[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

        Notifications: epoll

        Architecture:  amd64

        Disabled:      none

        Misc:          softdebug

        LLVM:          supported, not enabled.

        GC:            Included Boehm (with typed GC and Parallel Mark)

 

Running ASP.NET MVC4 on Ubuntu 12.04

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.