Table of Contents
Install .net 7.x
os:Ubuntu 20.04.4 LTS
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
Scripted install
quick start
wget https://dot.net/v1/dotnet-install.sh
sudo chmod +x ./dotnet-install.sh
./dotnet-install.sh --channel 7.0
output
dotnet-install: Attempting to download using aka.ms link https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.102/dotnet-sdk-7.0.102-linux-x64.tar.gz
source:https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install
printf 'deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft.gpg] https://packages.microsoft.com/ubuntu/22.04/prod jammy main\n' | sudo tee /etc/apt/sources.list.d/microsoft.list >/dev/null
Step 2: Install .NET SDK/Runtime & ASP.NET
Use apt-get to install .NET SDK/Runtime & ASP.NET runtime. Follow the installation instructions for Ubuntu as follow:
sudo apt install dotnet-sdk-7.0 dotnet-runtime-7.0 aspnetcore-runtime-7.0
output
Get:1 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 dotnet-runtime-deps-7.0 amd64 7.0.0-1 [2,892 B]
Get:2 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 dotnet-host amd64 7.0.0-1 [57.3 kB]
Get:3 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 dotnet-hostfxr-7.0 amd64 7.0.0-1 [144 kB]
Fetched 252 kB in 0s (531 kB/s)
Reading package lists... Done
...
# dotnet --info
output
.NET SDK:
Version: 7.0.100
Commit: e12b7af219
Runtime Environment:
OS Name: ubuntu
OS Version: 20.04
OS Platform: Linux
RID: ubuntu.20.04-x64
Base Path: /usr/share/dotnet/sdk/7.0.100/
Host:
Version: 7.0.0
Architecture: x64
Commit: d099f075e4
.NET SDKs installed:
6.0.202 [/usr/share/dotnet/sdk]
7.0.100 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.4 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
update SDK
sudo apt install dotnet-sdk-7.0 dotnet-runtime-7.0 aspnetcore-runtime-7.0
output
dotnet --info
.NET SDKs installed:
6.0.403 [/usr/share/dotnet/sdk]
7.0.202 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.11 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Uninstall/Remove .NET on Ubuntu 20.04(vultr)
step 1:
sudo apt remove dotnet-sdk-7.0 dotnet-runtime-7.0 aspnetcore-runtime-7.0 # remove the software packages.
or
How to Install .NET6 or 7 in Ubuntu 22.04 | 20.04, Debian 11/10 & Other Linux
https://fostips.com/ubuntu-22-04-net-6-how-to-install-other-linux/