How to install .Net Core on Ubuntu

Asked 1 year 9 months 15 days 19 hours 56 minutes ago, Viewed 1690 times

First, make sure your Ubuntu system is up to date. You can do this by executing the commands below in the terminal.

console:
sudo apt-get update
sudo apt-get upgrade

Then follow the steps below to install .NET Core 7 on Ubuntu 22.10.
Add the GPG key for the .NET Core repository and Install .NET Core 7 SDK.

console:
wget https://packages.microsoft.com/config/ubuntu/22.10/packages-microsoft-prod.deb -About packages-microsoft-prod.deb

sudo dpkg -i packages-microsoft-prod.deb

sudo apt-get update
sudo apt-get install -y dotnet-sdk-7.0

Verify that .NET Core 7 is installed correctly by executing the following command:

console:
dotnet --version
7.0.102

That's all. You should already have .NET Core 7 installed on your Ubuntu 22.10 system.


How to run .Net Core applications

To run a .NET Core app, go to the directory where the app's executable is located. For example:

console:
cd /path/to/directory
./application --urls=https://0.0.0.0:5001

Your app should now launch and start working. You can terminate it by pressing Ctrl+C in the terminal.


<<How to connect to mariaDB database>>