Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 6395  / 1 Year ago, fri, march 31, 2023, 2:30:02

I have two Ubuntu 22.04 systems with Dotnet 6.0. The one that has been continuously upgraded from older versions of Ubuntu runs my Dotnet Core 3.1 app without any trouble -- because it still has the old runtime (and libssl1.1) that are no longer available for 22.04.


The one running in WSL (i.e., Ubuntu under Windows) has the dotnet6.0 package, libssl1.1 downloaded from packages.ubuntu.com/focus, and aspnetcore-runtime-3.1 from microsoft .


But dotnet --info:


.NET SDK (reflecting any global.json):
Version: 6.0.108
Commit: 4e3a463d2b

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.108/sdk/6.0.108/

global.json file:
Not found

Host:
Version: 6.0.8
Architecture: x64
Commit: 55fb7ef977

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

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

Even though the runtime shows at /usr/share/dotnet/shared/Microsoft.NETCore.App/3.1.28/


More From » dotnet

 Answers
3

It turns out the Ubuntu choices for SDK and runtime location are incompatible with Microsoft's. So, it's nice to have the dotnet6 package to pull in all the packages, but the ones you want are actually Microsoft's! The key is to first create an apt preferences file:


derbro@L21PS773:~$ cat /etc/apt/preferences.d/dotnet.pref
Package: *
Pin: origin "packages.microsoft.com"
Pin-Priority: 1001

(which my working system already had based on instructions for making Dotnet 6.0 work, at Why don't any of these methods work for installing .Net Core SDK & runtime on 22.04 (Jammy Jellyfish)?. I actually didn't have a problem getting Dotnet 6 to work on this WSL installation, I just couldn't make it find the 3.1 runtime)


Now, install the 3.1 runtime or SDK per MS instructions:


wget https://packages.microsoft.com/config/ubuntu/20.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 -y aspnetcore-runtime-6.0
#or
sudo apt-get install -y dotnet-sdk-3.1

(if either fail to install because you're missing libssl1.1, you'll have to get that from https://packages.ubuntu.com/focal/libssl1.1 and install with dpkg --install)


Then upgrade your MS sources:


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

and install (or reinstall) dotnet6


sudo apt install dotnet6

[#250] Saturday, April 1, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
diket

Total Points: 167
Total Questions: 124
Total Answers: 109

Location: Somalia
Member since Wed, Mar 15, 2023
1 Year ago
diket questions
Fri, Dec 24, 21, 22:31, 2 Years ago
Mon, Jan 23, 23, 05:58, 1 Year ago
Tue, Nov 1, 22, 02:02, 2 Years ago
Sat, Dec 31, 22, 11:43, 1 Year ago
;