In this post I will show an easy way to manually install the .NET Core SDK on Ubuntu. For this we will download the binaries from the Microsoft CDN and run a few commands to perform the installation.
The Microsoft documentation already have an step-by-step guide on how to install the .NET Core SDK on Ubuntu. I'm just going to show an alternative way of how we can do this using a few command lines.
Before downloading we will define which version we will install. You can know the current version on the download page or view all versions already released on the GitHub page. After choose a version, replace the word
VERSION with the desired version in the folowing URL:
I chose the 2.2.401 version wihch is the latest stable version at the time I wrote this post. To download this version to the current directory run the following command:
curl -SL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/2.2.401/dotnet-sdk-2.2.401-linux-x64.tar.gz
Then, let's create the
dotnet directory using the
-p flag to create any necessary parent directories:
sudo mkdir -p /usr/share/dotnet
When the download is finished we will extract the .NET Core SDK binaries into
dotnet directory we just created:
sudo tar -zxf dotnet.tar.gz -C /usr/share/dotnet
Lastly we will create a symbolic link to the
/usr/bin directory, so we can run the dotnet command from any directory:
sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
Now, to make sure that the installation has completed successfully:
You should see the version you just installed.