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,055
  • 57
  • 82
  • 84
DaImTo
  • 175

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
1

Looks like Microsoft has not yet added 3.1.405 to their repository, which means you'll need to do a manual installation. Alternatively, it does appear to be available as a Snap if you choose to go that route.

.Net as a Snap

0

Is it that the package is named dotnet-sdk-3.1.405-1, note the -1? Perhaps the focal package list has not been updated/published yet?

root@Tyrell:/mnt/c/Users/craig# apt search dotnet-sdk-3.1
Sorting... Done
Full Text Search... Done
dotnet-sdk-3.1/bionic 3.1.405-1 amd64
  Microsoft .NET Core SDK 3.1.405
0

Download the sdk at https://dotnet.microsoft.com/en-us/download

remove the existing one

$sudo rm -r /usr/share/dotnet

unzip the downloaded one rename it as dotnet and replace

$sudo mv Downloads/dotnet /usr/share/