2

I have .NET6 runtime installed on Ubuntu 22.04

$ dotnet --list-runtimes
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]

And tried to install ASP.NET Core Runtime 7.0.0-rc.1 but without any success. Any idea, please?

Ref:

user2771704
  • 5,994
  • 6
  • 37
  • 38
AmD
  • 33
  • 1
  • 6

4 Answers4

1

Thanks for interesting.
So, I ended up with this solution

1-

curl https://download.visualstudio.microsoft.com/download/pr/0857e86d-4206-4c14-b814-e5e3424f8396/6e1113fce778ef9ff69eb2ffefd6de76/aspnetcore-runtime-7.0.0-rc.1.22427.2-linux-musl-x64.tar.gz -o aspnetcore-runtime-7.0.0-rc.1.22427.2-linux-musl-x64.tar.gz

2-

mkdir dotnet7-7.0.100-rc.1

3-

tar xvf aspnetcore-runtime-7.0.0-rc.1.22427.2-linux-musl-x64.tar.gz -C dotnet7-7.0.100-rc.1

4- (Optional; sure, if not exist before)

sudo mkdir /usr/lib/dotnet

5-

sudo cp -R dotnet7-7.0.100-rc.1 /usr/lib/dotnet/dotnet7-7.0.100-rc.1

6-

sudo ln -sf /usr/lib/dotnet/dotnet7-7.0.100-rc.1 /etc/alternatives/dotnet7rc1

7-

sudo ln -sf /usr/lib/dotnet/dotnet7-7.0.100-rc.1/dotnet /etc/alternatives/dotnet

Ref: https://dotnet.microsoft.com/en-us/download/dotnet/7.0

AmD
  • 33
  • 1
  • 6
0

And tried to install ASP.NET Core Runtime 7.0.0-rc.1 but without any success. Any idea, please?

Tough .NET 7 RC 1 has been released. However, regarding Linux Runtime compatibility there is not official guideline yet. Furthermore, here is the open GitHub thread you can post your issue.

Up to now, for Ubuntu 22.04 dotnet-runtime-6.0 has official instructions where you should consider following scenarios:

  1. Clean machine (Haven't installed dotnet before)
  2. Mixed-state (Installed dotnet before but want to update`)

Note: Please consider your state first, depending on the scenario command might changed. For example, if you encounter any error on executing this command udo apt-get install -y aspnetcore-runtime-6.0 that scenario, you should replace with below command.

sudo apt-get install -y dotnet-runtime-6.0

Suggested Commnad:

As per your scenario, you could follow below command as suggested here:

sudo apt remove dotnet*
sudo apt remove aspnetcore*
sudo rm /etc/apt/sources.list.d/microsoft-prod.list*
sudo apt update
sudo apt install aspnetcore-runtime-6.0

You could check details here in official GitHub thread.

Md Farid Uddin Kiron
  • 16,817
  • 3
  • 17
  • 43
0

Go to https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-7.0.100-linux-x64-binaries and follow the instruction. Just installed on Ubuntu 22.04

Do not forget to update the shell profile as indicated in the instructions

p.s. I started the service and in my case I had to replace /usr/bin/dotnet with /root/dotnet/dotnet

[Unit]
Description=PotokWebRoot

[Service]
WorkingDirectory=/var/www/PotokWebRoot
ExecStart=/root/dotnet/dotnet /var/www/PotokWebRoot/PotokWeb.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=potok
User=root
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false

[Install]
WantedBy=multi-user.target
0

Had the similar issues when wanted to migrate the 2 projects from .NET 6 to .NET 7 on Ubuntu 22.04.1 with frustrating errors like dotnet-sdk-7.0 NOT found or it is not release candidate (also got the same errors for aspnetcore-runtime-7.0 and dotnet-runtime-7.0).

As I understood later I had machine with Mixed-state according to this link.

The only solution which helped me it is Solution 3 from Microsoft documentation Ubuntu 22.04 troubleshooting (don't know why Solution 2 did not work for me). Below I wrote what I do:

  1. Removed installed .NET 6 with the next commands
sudo apt remove 'dotnet*' 'aspnet*' 'netstandard*'
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
sudo apt update
sudo apt install dotnet-sdk-7.0
  1. Created the /etc/apt/preferencesList file with sudo nano and paste the next content in it:
Package: dotnet-sdk-7.0
Pin: origin "packages.microsoft.com"
Pin-Priority: 999
  1. Ran the next command in console which installed dotnet-sdk-7.0 correctly
sudo apt-get update && sudo apt-get install -y dotnet-sdk-7.0
  1. Updated net6.0 with net7.0 in ExecStart for service files related to the 2 projects (in /etc/systemd/system/ folder)
user2771704
  • 5,994
  • 6
  • 37
  • 38