阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

CentOS设置Mono环境变量

190次阅读
没有评论

共计 1852 个字符,预计需要花费 5 分钟才能阅读完成。

CentOS 设置 Mono 环境变量

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:$PATH
export 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)

Ubuntu 15.04 和 CentOS 7 部署 .NET,Mono and DNX  http://www.linuxidc.com/Linux/2015-05/117177.htm

在 Linux(Ubuntu/openSUSE/CentOS)下配置 ASP.NET(Apache + Mono)http://www.linuxidc.com/Linux/2013-07/87599.htm

配置 Linux(Apache) + Mono 下运行 asp.net http://www.linuxidc.com/Linux/2013-07/87598.htm

如何升级 Mono http://www.linuxidc.com/Linux/2013-06/85391.htm

在 Mono 3.0 下运行 ASP.NET 4 网站的主意事项 http://www.linuxidc.com/Linux/2013-06/85394.htm

在 Ubuntu 操作系统上安装 Mono 和 Jexus 搭建.NET 的运行环境 http://www.linuxidc.com/Linux/2013-06/85388.htm

更多 CentOS 相关信息见 CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14

本文永久更新链接地址 :http://www.linuxidc.com/Linux/2015-05/117793.htm

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-20发表,共计1852字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中