How and what do i need to install .NET on CentOS 7?


#1

I need to be able to re-compile and test some libraries I plan on using in a server environment. What do I need to know to do this on CentOS 7? I am looking at the .NET Core.


#2

Did you try our existing instructions for Linux? Did they work?


#3

“Install .NET Core on CentOS 7”
+1


#4

There are binaries available for download on this .net github repo https://github.com/dotnet/cli for Centos 7.2 .
For instructions extract the tarball and add dotnet executable binary to the path. from then on wards follow any other Linux distro instructions. :neutral_face:

edit : and don’t forget to install these pacakages
deltarpm
epel-release
unzip
libunwind
gettext
libcurl-devel
openssl-devel
zlib
libicu-devel


#5

Instal as:
sudo yum install libunwind libicu
curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?linkid=848821
sudo mkdir -p /opt/dotnet && sudo tar zxf dotnet.tar.gz -C /opt/dotnet
sudo ln -s /opt/dotnet/dotnet /usr/local/bin

then test it:
dotnet new console -o hwapp
cd hwapp
dotnet restore
dotnet run


#6

.NET Core is now part of CentOS 7!

You can install .NET Core 2.0 using the following steps:

.NET Core 2.0

Install it:

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

Then, to use it:

scl enable rh-dotnet20 bash
dotnet --info

.NET Core 1.1

Install it:

yum install centos-release-dotnet
yum install rh-dotnetcore11

Then, to use it:

scl enable rh-dotnetcore11 bash
dotnet --info

.NET Core 1.0

Install it:

yum install centos-release-dotnet
yum install rh-dotnetcore10

Then, to use it:

scl enable rh-dotnetcore10 bash
dotnet --info

#7

after omajid answer
To Permanently enable .NET Core in your development environment
edit ~/.bashrc
and add the following line
#Add dotnet core to my login .
source scl_source enable rh-dotnet20
log out and login again
that make it run every time you log in

(https://developers.redhat.com/products/dotnet/hello-world/#enable-permanently)


.NET Foundation Website | Blog | Projects | Code of Conduct