Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»SDK»How to Install Dotnet Core on Ubuntu 20.04

    How to Install Dotnet Core on Ubuntu 20.04

    RahulBy RahulAugust 24, 20203 Mins ReadUpdated:April 7, 2021

    The .NET Core is a free and open-source software framework designed with keeping Linux and macOS in mind. It is a cross-platform successor to .NET Framework available for Linux, macOS and Windows systems. .NET Core framework already provides scaffolding tools for bootstrapping projects.

    This tutorial is an walk through to install dotnet core on Ubuntu 20.04 LTS Linux system. Also created a sample application using dotnet core.

    Step 1 – Enable Microsoft PPA

    First of all, enable Microsoft packages repository on your Ubuntu system. The Microsoft official team provides a debian packages to setup PPA on your system.

    Open a terminal on your Ubuntu system and configure Microsoft PPA by run the following commands:

    wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb 
    sudo dpkg -i packages-microsoft-prod.deb 
    

    Step 2 – Installing Dotnet Core SDK

    .NET Core SDK is the Software development kit used for developing applications. If you are going to create a application or making changes to existing application, you will required .net core sdk package on your system.

    To install .NET Core SDK on Ubuntu 20.04 LTS system, execute the commands:

    sudo apt update 
    sudo apt install apt-transport-https 
    sudo apt install dotnet-sdk-3.1 
    

    To install the previous version of .Net Core SDK 2.1, type:

    sudo apt install dotnet-sdk-2.1
    

    Press “y” for any input prompted by the installer.

    That’s it. You have successfully install .Net core SDK on your Ubuntu system.

    Step 3 – Install Dotnet Core Runtime Only

    .NET Core Runtime is required for the system, where you only need to run application. For example, production or stating environments are required to run applications only.

    To install .NET Core Runtime on Ubuntu 20.04 LTS system, execute the commands:

    sudo apt update 
    sudo apt install apt-transport-https 
    sudo apt install dotnet-runtime-3.1 
    

    To install the previous version of .Net core runtime 2.1, type:

    sudo apt install dotnet-runtime-2.1
    

    Press “y” for any input prompted by the installer.

    That’s it. You have successfully install .Net core runtime on your Ubuntu system.

    Step 4 – (Optional) Check .NET Core Version

    You can use dotnet command line utility to check installed version of .NET Core on your system. To check dotnet version, type:

    dotnet --version
    
    3.1.401
    

    Step 5 – Create Sample Application

    Let’s create a sample application with dotnet core on your Ubuntu system. Create a new console application with the command:

    dotnet new console -o HelloWorld
    

    The Above command will create dotnet application on your system. This will create a directory named “helloworld” in under the current directory. You can change to this directory and start working your application.

    cd  HelloWorld
    

    Make your changes to application and execute below command to run this application.

    dotnet run
    

    You will see the below output on terminal. 3

    dotnet core hello world example

    Conclusion

    In this tutorial, you have learned to install .NET Core SDK and Runtime on a Ubuntu 20.04 LTS (Focal Fossa) Linux system.

    .NET Core dotnet microsoft
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Install ZSH (Z Shell) on Ubuntu 20.04
    Next Article How To Install Skype on Ubuntu 20.04

    Related Posts

    How To Install Google Cloud SDK on Ubuntu 20.04

    Updated:February 22, 20213 Mins Read

    How to Install .NET Core on Debian 10

    2 Mins Read

    How to Install .NET Core in Ubuntu 18.04

    Updated:April 6, 20212 Mins Read

    How to Install Mono on Ubuntu 18.04 & 16.04

    Updated:March 31, 20202 Mins Read

    Complete Setup Guide for Android SDK / ADT Bundle on Ubuntu

    2 Mins Read

    9 Comments

    1. John on May 14, 2022 3:40 am

      Doesn’t work on Jammy Jellyfish

      sudo wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb
      sudo dpkg -i packages-microsoft-prod.deb

      sudo apt update

      sudo apt list (I can see the package dotnet-runtime-6.0) in the list of available packages however

      sudo apt install dotnet-runtime-6.0 results in the message:

      E: Unable to locate package dotnet-runtime-6.0
      E: Couldn’t find any package by glob ‘dotnet-runtime-6.0’

      Reply
      • John on May 14, 2022 3:43 am

        Seems there is no arm64 version on the repo

        Reply
      • Rahul on May 16, 2022 4:38 am

        Hi John,

        .net core packages are not available for Jammy Jellyfish yet.

        Reply
    2. Specky Ferns on April 29, 2021 12:20 am

      Beautiful, most helpful, thanks Rahul!

      Reply
    3. kyle on April 21, 2021 1:17 am

      So glad I stumbled on this article. My system is so much faster now

      Reply
    4. Rida on April 5, 2021 7:45 am

      Thankiuuu so much… It really help me out.

      Reply
    5. Brandy Maki on December 31, 2020 5:17 am

      Thank you!

      Reply
    6. Mervin Sanchez on September 30, 2020 10:18 pm

      The app .netcore using runtime 3.0.
      How install dotnet-runtime-3.0 on Ubuntu 20.04 ?
      Thank you

      Reply
      • Rahul on October 1, 2020 2:56 am

        Hi Mervin,

        I hope the application build on .net core 3.0 should be compatible with .netcore 3.1. Are you facing any error if run app with 3.1?

        Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.