How do I install .netcore on a CentOs machine?

I am new to .NET core and I am trying to run some basic examples on a CentOS machine.

I read the Microsoft documentation and found these steps are the closest guide to what I want to do:

http://dotnet.github.io/core/getting-started/

After following these steps, I can run a test / sample application, but only under mono (e.g. after release

$ dnvm use [version] -r mono

followed by

$ dnu restore

and

$ dnx. mileage

)

When running in .NET Core ($ dnvm use [version] -r coreclr) I get the following error:

dnx: / usr / lib64 / libstdc ++. so.6: version GLIBCXX_3.4.14' not found (required by dnx) dnx: /usr/lib64/libstdc++.so.6: version

GLIBCXX_3.4.15 'not found (dnx required)

I tried updating my gcc but to no avail. I also found that there were some bugs on release:

$ yum install libunwind8 libssl-dev unzip

Files libunwind8, libssl-dev not found.

Are the two related? Has anyone successfully installed .NET core on CentOS? If you could point me to a guide or explain the process?

Thank!

+3


source to share


3 answers


You can now install .NET Core on CentOS 7 by following these steps:

yum install centos-release-dotnet
yum install rh-dotnet20

      



To use it:

scl enable rh-dotnet20 bash
dotnet --info

      

+4


source


Here is the script I am using to install CoreCLR on CentOS 7. I tested this against two installations on VirtualBox:

My test virtual machines

CentOS 7 with desktop included and GNOME networking

CentOS 7 with networking enabled (almost minimal install, all you get is a terminal, but your network card works so you can download stuff)

I go back to a clean install point to rerun the tests.

Yum packages

Note that the original poster got stuck trying to figure out the yum versions of CoreCLR dependencies. I believe I did it. I haven't had any problems at this point, but CoreCLR is experimental and we're on beta 7 for this answer.

Please note that for all these steps in installing CentOS without installing malware, the GNOME desktop is installed, but in the comments I notice that you don't need.

This script never installs Mono and should be good to play with CoreClr. However, I put both on the machine and it works, but that is beyond the scope of the answer.

## Get DNVM
curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | DNX_BRANCH=dev sh && source ~/.dnx/dnvm/dnvm.sh

## install unzip before installing any dnx versions
## (appears to already be installed on CentOS with GNOME)
sudo yum install -y unzip

## Install CoreCLR latest
dnvm install latest -r coreclr

## install libuv
## dnu restore won't operate without this
## (curl already latest version, but ASP.NET on Linux docs currently have this... harmless)
sudo yum -y install automake libtool curl
curl -sSL https://github.com/libuv/libuv/archive/v1.4.2.tar.gz | sudo tar zxfv - -C /usr/local/src
cd /usr/local/src/libuv-1.4.2
sudo sh autogen.sh
sudo ./configure
sudo make
sudo make install
sudo rm -rf /usr/local/src/libuv-1.4.2 && cd ~/
sudo ldconfig

## libunwind.x86_64 is in the epel-release repository
## (Not necessary on GNOME, minimal install does not have this installed)
sudo yum -y install epel-release

## Install these CoreCLR dependencies before dnu restore
sudo yum -y install libunwind gettext libcurl-devel openssl-devel zlib

      

Libuv not found



So, after you have done all that, you can use yeoman asp.net generators to get the project. I usually test ConsoleApplication and WebApplicationBasic. However, when trying to use WebApplicationBasic with

dnx kestrel

      

It blows up because the kestrel wants to use libuv and cannot load it. One way to work around this problem is to set the environment variable: LD_LIBRARY_PATH = / usr / local / lib.

But I was not happy with that. Thanks to paule96 on GitHub, I learned that you can create symlinks, so libuv can be found empty at startup:

ln -s /usr/lib64/libdl.so.2 /usr/lib64/libdl
ln -s /usr/local/lib/libuv.so /usr/lib64/libuv.so.1

      

If you want to know how to install node, yoman and aspnet generators use this:

## rpm for node 0.12 on centos from nodesource
sudo rpm -ivh https://rpm.nodesource.com/pub_0.12/el/7/x86_64/nodejs-0.12.7-1nodesource.el7.centos.x86_64.rpm 

## yeoman and aspnet generators
sudo npm install -g yo
sudo npm install -g generator-aspnet

      

Regards, I would ask the original poster to modify the question to mention that this is for the ASP.NET 7 beta. There are still changes that need to be made and I may have to update my scripts. But if it says it clearly, we don't have to worry about the answer becoming obsolete.

For example: How to configure ASP.NET 5 Beta 7 on CoreCLR for CentOS? or How to setup Beta 7.NET CoreCLR on CentOS?

I also ask you to consider adding the asp.net-5 tag if you don't really think your question is related to this.

+3


source


Thanks for the doc, but the question the OP and I had was about Microsoft.net impl, not Mono. As many may know, Microsoft opened the .Net network in early 2015 and is actively trying to make it xplat. Please look:

https://github.com/dotnet/coreclr

https://github.com/aspnet/home

+1


source







All Articles