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
  • 19,395
  • 55
  • 76
  • 81
DaImTo
  • 175
  • 1
  • 2
  • 7

3 Answers3

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
  • 1) 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
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

  • About snap, did the upgrade to 20 remove that or something i swear i had it before. – DaImTo Jan 19 '21 at 13:46
  • Snaps are very much alive and well in Ubuntu 20.04 and 20.10. When you type `snap list` in the terminal, do you see an error or something suggesting installing "Hello World"? –  Jan 19 '21 at 13:50
  • Well that worked, i downloaded it untared it and dumped it over in the same folder with the other ones in /usr/share. cp command was the only scary part for me. Thank you for your help :) – DaImTo Jan 19 '21 at 13:57
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
  • There's still no dotnet-sdk-3.1 package found either by `rmadison dotnet-sdk-3.1` or on Ubuntu Packages Search website. – karel Jan 19 '21 at 14:01