Dot Net For All

Correct Steps to install .Net core run-time and SDK on Ubuntu

Hello friends, In this article I will list down the correct steps to install .Net core run-time and sdk on Ubuntu machine. I have create a Ubuntu instance in AWS.

Before starting the installation of the .NET core on Ubuntu or Linux distribution you should have access to Linux machine. To get a Linux machine and connect it through windows you can read this article.

Install .Net core run-time and SDK on Ubuntu

One you are done with creation of Ubuntu instance in the AWS. You can SSH or do a remote login from windows.

Once logged in run the below commands one by one.

Once you are done with update further execute below two commands

and run the update command one more

followed by final command as shown in the figure below

sudo apt-get update
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install dotnet-runtime-2.1

Once you are done with installation of .NET core run-time, its time to create first .NET core application in Ubuntu or Linux distribution. The above commands are enough to run .NET Core application on production server.

But if you want to develop .NET core application on the Ubuntu or Linux distribution, you need to install .NET core SDK. And the command for the same is mentioned below

or you can copy from below text:

sudo apt-get install dotnet-sdk-2.2

Creating First .NET core App on Ubuntu

And lets create out first hello world application on Ubuntu

In the above figure, I have created a new directory named console app. I went to the directory. . Created a new console application using “dotnet new console” command.

And to be sure, I listed out the contents of the directory using “ls” command. And finally executed the application using “dotnet run” command. Getting the output as “Hello world”.

After executing the run command you can see there are two more folders created for libraries named bin and obj

Conclusion

Hope this article will help you to install .Net core run-time and sdk on Ubuntu and start with your first console application.

For further reading you can read about the first CLI project on this link.

Top career enhancing courses you can't miss

My Learning Resource

Excel your system design interview