Mono是一个可在Linux上运行C#软件的工具,还可跨别的平台。其Moma小工具可提前检测是否跨平台支持。下面介绍CentOS7安装Mono并保留离线安装包的方法。
1.本人在Hyper-V下面新建虚拟机安装minimal最小安装版的CentOS7系统;
2.安装好系统后,要保证网是联通的;
3.首先安装net-tools工具,使用yum install
net-tools命令,不然连ifconfig都没有没法看本地ip地址;
4.安装一个yum-utils工具包,不然没有yum-config-manager工具,使用命令yum install
yum-utils来安装;
5.安装Mono官网上配置软件源,有两条指令,如下:
rpm --import
"http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
yum-config-manager
--add-repo http://download.mono-project.com/repo/centos/
6.配置好源之后,就准备安装mono了,官网上说一共4个软件包,分别为:
The
package mono-devel should
be installed to compile code.
The
package mono-complete should
be installed to install everything - this should cover most cases
of “assembly not found” errors.
The
package referenceassemblies-pcl should
be installed for PCL compilation support - this will resolve most
cases of “Framework not installed: .NETPortable” errors during
software compilation.
The
package ca-certificates-mono should
be installed to get SSL certificates for HTTPS connections. Install
this package if you run into trouble making HTTPS
connections.
大概含义是说都装上没坏处。
7.使用这个命令,先将安装包下载到本地/home/samba/rpms/mono路径,当然要提前创建好此路径:
yum --downloadonly
--downloaddir=/home/samba/rpms/mono install mono-devel mono-complete referenceassemblies-pcl ca-certificates-mono
8.全部下载完成后在下载目录使用rpm -iv *.rpm进行安装即可,也可以使用下面命令重新下载完整安装:
yum
install mono-devel mono-complete referenceassemblies-pcl ca-certificates-mono
大概就是这样了。