7

Currently have the .net sdk 3.1.404 installed. There is a newer version out Download .NET Core 3.1 SDK 3.1.405.

I am trying to figure out how to upgrade this on my machine. Part of my problem is that all the documentation is on how to install .net 5.0 which is not what i need currently i need the latest SDK for 3.1 in the project i am working on.

Currently installed versions:

linda@linda-ThinkPad-X1-Extreme-2nd:~/development/$ dotnet --list-sdks
2.2.402 [/usr/share/dotnet/sdk]
3.1.404 [/usr/share/dotnet/sdk]
5.0.101 [/usr/share/dotnet/sdk]

I tried running:

sudo apt-get update; \
  sudo apt-get install -y apt-transport-https && \
  sudo apt-get update && \
  sudo apt-get install -y dotnet-sdk-3.1.405

Which resulted in:

E: Unable to locate package dotnet-sdk-3.1.405
E: Couldn't find any package by glob 'dotnet-sdk-3.1.405' E: Couldn't find any package by regex 'dotnet-sdk-3.1.405'

Then I tried:

sudo apt-get install dotnet-sdk-3.1

Which then resulted in the following message:

dotnet-sdk-3.1 is already the newest version (3.1.404-1).

As you can see I am a little new at running Linux for my development desktop any help would be greatly appreciated.

My current Ubuntu version is:

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:    20.04
Codename:   focal
Kevin Bowen
  • 20,125
  • 57
  • 82
  • 84
DaImTo
  • 173

4 Answers4

4

Looks like the package is not yet available. You can try to install it 'by hand'. I just tested in a docker and looks fine:

$ wget https://packages.microsoft.com/config/ubuntu/20.10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
$ dpkg -i packages-microsoft-prod.deb
$ apt-get update
$ apt-get install -y apt-transport-https 
$ apt-get update
$ apt-get install -y dotnet-sdk-5.0
$ wget https://download.visualstudio.microsoft.com/download/pr/5de23f6d-648c-455b-a7a9-d11c9a5bca40/4836262466f2d288e8ad8647944d062f/dotnet-sdk-3.1.405-linux-x64.tar.gz
$ export DOTNET_ROOT=/usr/share/dotnet
$ tar zxf dotnet-sdk-3.1.405-linux-x64.tar.gz -C $DOTNET_ROOT
$ dotnet --list-sdks

3.1.405 [/usr/share/dotnet/sdk] 5.0.102 [/usr/share/dotnet/sdk]

I always install sdk by hand in a home folder following this instructions from: https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-3.1.405-linux-x64-binaries

danihp
  • 141
  • 3
  • Why dotnet-sdk-5.0? and how are you getting it into /usr/share/former/sdk? – DaImTo Jan 19 '21 at 21:37
  • Net5 because I saw you have it already installed, just to set my scenario closer to yours. 2) what is former? I just download SDK with wget and unpack into /usr/share/dotnet You can see commands on answer (wget, export, tar)
  • – danihp Jan 20 '21 at 12:37
  • $DOTNET_ROOT is /usr/share/dotnet ? – DaImTo Jan 20 '21 at 12:42
  • Yes, It is. If you want, skip the export command and write path instead environment var on tar command. – danihp Jan 20 '21 at 12:54
  • 1
    thanks so much for this! for anybody using 18.04 and hopelessly trying to get 7.0, this is the only thing that works without a distro upgrade etc. – GrumpyRodriguez Nov 15 '22 at 09:02