Skip to content

Instantly share code, notes, and snippets.

@codedeep79
Last active January 4, 2025 01:51
Show Gist options
  • Select an option

  • Save codedeep79/7222f0ef719e0da207ece075da01fc82 to your computer and use it in GitHub Desktop.

Select an option

Save codedeep79/7222f0ef719e0da207ece075da01fc82 to your computer and use it in GitHub Desktop.
Install Dotnet Core on Ubuntu 20.04

Step 1 – Enable Microsoft PPA

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

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

Để cài đặt phiên bản trước là .Net Core SDK 2.1, nhập trên terminal: sudo apt install dotnet-sdk-2.1

Step 3 – Install Dotnet Core Runtime Only

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

Để cài đặt phiên bản trước l .Net core runtime 2.1, nhập trên terminal: sudo apt install dotnet-runtime-2.1

Step 4 – (Optional) Check .NET Core Version

dotnet --version

Step 5 – Create Sample Application

dotnet new console -o HelloWorld
cd  HelloWorld
dotnet run
@nitinjs
Copy link
Copy Markdown

nitinjs commented Aug 15, 2024

how to install .NET CORE SDK 2.0? it fails
I have installed latest .net 8 and there is some conflict

@codedeep79
Copy link
Copy Markdown
Author

codedeep79 commented Jan 4, 2025

Installing .NET Core SDK 2.0 on a system with the latest .NET 8 may result in conflicts so you can uninstall conflicting .NET versions and install .NET CORE SDK 2.0 again:

wget https://dotnetcli.blob.core.windows.net/dotnet/Sdk/2.0.0/dotnet-sdk-2.0.0-linux-x64.tar.gz
mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-2.0.0-linux-x64.tar.gz -C $HOME/dotnet
export PATH=$HOME/dotnet:$PATH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment