3

I recently updated my Ubuntu distro to 22.04 from 20 and now it seems I cannot install dotnet sdks correctly. I have dotnet installed with 6 but I need 3.1 now and I don't remember how I did it with dotnet 6.

Here's what I did.

$ wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
$ sudo dpkg -i packages-microsoft-prod.deb
$ rm packages-microsoft-prod.deb

$ sudo apt-get update
$ sudo apt-get install dotnet-sdk-3.1

All of those commands finished successfuly. apt-get found the dotnet sdk package and installed it. However, when I call dotnet --list-sdks, I don't see 3.1.

So my thought is that maybe dotnet is installed differently and can't find SDKs installed using apt-get (below, I've included some debug info for dotnet installation on my machine). But if this is the case, then how do I install them? Everywhere I look online tells me to just use the package manager or snap but none of those work.

Debug Info

Some helpful (let me know if I should include more) debug info.

$ whereis dotnet

dotnet: /usr/bin/dotnet /usr/lib/dotnet /etc/dotnet /usr/share/dotnet /usr/share/man/man1/dotnet.1.gz
$ dotnet --info

.NET SDK (reflecting any global.json):
 Version:   6.0.109
 Commit:    58a93139d8

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         ubuntu.22.04-x64
 Base Path:   /usr/lib/dotnet/dotnet6-6.0.109/sdk/6.0.109/

global.json file:
  Not found

Host:
  Version:      6.0.9
  Architecture: x64
  Commit:       163a63591c

.NET SDKs installed:
  6.0.109 [/usr/lib/dotnet/dotnet6-6.0.109/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.9 [/usr/lib/dotnet/dotnet6-6.0.109/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.9 [/usr/lib/dotnet/dotnet6-6.0.109/shared/Microsoft.NETCore.App]

Download .NET:
  https://aka.ms/dotnet-download

Learn about .NET Runtimes and SDKs:
  https://aka.ms/dotnet/runtimes-sdk-info
$ sudo apt show dotnet -a

Package: dotnet
State: not a real package (virtual)
N: Can't select versions from package 'dotnet' as it is purely virtual
N: No packages found
$ sudo apt show dotnet-sdk-3.1 -a

Package: dotnet-sdk-3.1
Version: 3.1.424-1
Priority: standard
Section: devel
Maintainer: Microsoft <dotnetcore@microsoft.com>
Installed-Size: 198 MB
Depends: libc6 (>= 2.14), libgcc1 (>= 1:3.0), libstdc++6 (>= 4.6), dotnet-targeting-pack-3.1 (>= 3.1.0), netstandard-targeting-pack-2.1 (>= 2.1.0), dotnet-apphost-pack-3.1 (>= 3.1.30), aspnetcore-targeting-pack-3.1 (>= 3.1.10), dotnet-runtime-3.1 (>= 3.1.30), aspnetcore-runtime-3.1 (>= 3.1.30)
Homepage: https://dotnet.github.io/core
Download-Size: 49.8 MB
APT-Manual-Installed: yes
APT-Sources: https://packages.microsoft.com/ubuntu/22.04/prod jammy/main amd64 Packages
Description: Microsoft .NET Core SDK 3.1.424
 .NET Core is a development platform that you can use to build command-line applications, microservices and modern websites. It is open source, cross-platform and is supported by Microsoft. We hope you enjoy using it! If you do, please consider joining the active community of developers that are contributing to the project on GitHub (https://github.com/dotnet/core). We happily accept issues and PRs.

Package: dotnet-sdk-3.1
Version: 3.1.423-1
Priority: standard
Section: devel
Maintainer: Microsoft <dotnetcore@microsoft.com>
Installed-Size: 198 MB
Depends: libc6 (>= 2.14), libgcc1 (>= 1:3.0), libstdc++6 (>= 4.6), dotnet-targeting-pack-3.1 (>= 3.1.0), netstandard-targeting-pack-2.1 (>= 2.1.0), dotnet-apphost-pack-3.1 (>= 3.1.29), aspnetcore-targeting-pack-3.1 (>= 3.1.10), dotnet-runtime-3.1 (>= 3.1.29), aspnetcore-runtime-3.1 (>= 3.1.29)
Homepage: https://dotnet.github.io/core
Download-Size: 49.8 MB
APT-Sources: https://packages.microsoft.com/ubuntu/22.04/prod jammy/main amd64 Packages
Description: Microsoft .NET Core SDK 3.1.423
 .NET Core is a development platform that you can use to build command-line applications, microservices and modern websites. It is open source, cross-platform and is supported by Microsoft. We hope you enjoy using it! If you do, please consider joining the active community of developers that are contributing to the project on GitHub (https://github.com/dotnet/core). We happily accept issues and PRs.
Ian Kirkpatrick
  • 1,861
  • 14
  • 33

1 Answers1

0

There is no official support for anything lower than 6.0 according to this.

The following table is a list of currently supported .NET releases and the versions of Ubuntu they're supported on.

Ubuntu          .NET
22.04 (LTS)     6+
20.04 (LTS)     3.1, 6
18.04 (LTS)     3.1, 6
16.04 (LTS)     3.1, 6

On same page you can find a note

Ubuntu 22.04 includes OpenSSL 3 as the baseline version. .NET 6 supports OpenSSL 3 while earlier .NET versions don't. Microsoft doesn't test or support using OpenSSL 1.x on Ubuntu 22.04. For more information, see .NET 6 Security Improvements.

The explanation is that latest LTS made a breaking change switch of OpenSSL library from v1.1.x to v3.0.0.

P.S. There is also an article here which states that one should not be afraid to migrate to dotnet 6

Please start migrating your apps to .NET 6, particularly .NET 5 apps. We have heard from early adopters that upgrading to .NET 6 is straightforward from .NET Core 3.1 and .NET 5.

Victor Yarema
  • 1,183
  • 13
  • 15
  • 1
    Oh, if microsoft says there will be zero regression when moving to .Net 6.0, They're perfectly impartial for evaluating their own software update so they must be right ! – XouDo May 29 '23 at 15:37