Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install .NET Core in Amazon Linux 2 using yum

I cannot find a straightforward way of installing dotnet 2.2 on a AWS Linux 2 AMI.

There was some announcements that there was pre-built AMI's with it installed, but the ones I see, also have different versions of MSSQL Server.

Isn't there a way to install dotnet core 2.2 using yum or getting an AMI without SQL Server?

I found Run .NET programs on Amazon Linux AMI but I wonder if it is still valid, and if there is not an easier way.

like image 247
Vlad Avatar asked May 07 '19 16:05

Vlad


People also ask

Does Amazon Linux have yum?

Amazon Linux instances manage their software using the yum package manager. The yum package manager can install, remove, and update software, as well as manage all of the dependencies for each package.

Can you use .NET Core on Linux?

The . NET Core runtime allows you to run applications on Linux that were made with . NET Core but didn't include the runtime. With the SDK you can run but also develop and build .


2 Answers

The following works for .NET Core 3.1 on Amazon Linux 2:

sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
sudo yum install dotnet-sdk-3.1

(or dotnet-sdk-5.0 for .NET 5)

More detail here: https://docs.microsoft.com/en-us/dotnet/core/install/linux-centos#centos-7-

If you're using AWS Elastic Beanstalk, and you only need the runtime (not the SDK) then you can just use the .NET Core / Linux platform.

like image 188
Will Avatar answered Sep 21 '22 16:09

Will


Have you tried the following:

sudo yum update 
sudo yum install dotnet-sdk-2.2

Also this link might help: https://dotnet.microsoft.com/download/linux-package-manager/centos/sdk-current

like image 29
smitty_werbenjagermanjensen Avatar answered Sep 17 '22 16:09

smitty_werbenjagermanjensen