The Right Way to Install Dotnet in AlmaLinux 8 10

Learn the instructions to install .Net Framework and runtime on AlmaLinux 8 utilizing terminal and DNF package deal supervisor.

.NET is a free, cross-platform, open-source developer platform from Microsoft that can be utilized to create and run packages for Windows. The software program is pronounced “dot-net framework”. Programmers can use .NET to develop and check their very own software program for Windows computer systems. Several programming languages ​​akin to C# or C++ are supported in order that as many programmers as doable can use this system to construct for net, cell, desktop, video games, and IoT.

If you install a program that was created with .NET, you additionally want the .NET Framework. This ensures that every one features of the software program work appropriately in your laptop.

Well, set up of Dotnet is fairly straightforward on Windows, nonetheless, being open-source and cross-platform it may also be put in on Linux for the event of .Net-based functions.

Steps to install .NET Runtime & SDK on Almalinux 8

The steps given right here would be the identical for different RedHat-based Linux working programs akin to Oracle Linux, CentOS, Rocky Linux, and others…

#1st technique utilizing Dnf Package supervisor

1. Run Update command

As we’re going to use the DNF package deal supervisor and official repositories of Almalinux 8, therefore, first run the system replace command:

sudo dnf replace --refresh


2. Install Dotnet on Almalinux 8

The packages we have to configure Dotnet on Almalinux can be found to install utilizing its official App stream and base repositories. Hence, comply with the given instructions to install runtime and SDK.

For each .Net instruments, runtime, and SDK:

sudo dnf install dotnet

For solely .Net Runtime:

sudo dnf install dotnet-runtime-6.0

For NET Software Development Kit

The newest model whereas doing this text of .Net SDK was 6.0, therefore to install use:

sudo dnf install dotnet-sdk-6.0

Note: For different variations, simply want to alter the 6.0 with that. You can examine what are the out there variations to install by utilizing a command:

sudo dnf search dotnet


3. Check the Version

Once the set up is accomplished, we are able to examine the model of put in Dotnet by utilizing its command-line instrument, right here is that.

dotnet --info


.NET SDK (reflecting any international.json):
Version: 6.0.103
Commit: 2c677ffc1e

Runtime Environment:
OS Name: Almalinui
OS Version: 8.5
OS Platform: Linux
RID: rhel.8-x64
Base Path: /usr/lib64/dotnet/sdk/6.0.103/

Host (helpful for assist):
Version: 6.0.3
Commit: c24d9a9c91

.NET SDKs put in:
6.0.103 [/usr/lib64/dotnet/sdk]

.NET runtimes put in:
Microsoft.AspNetCore.App 6.0.3 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.3 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]


4. Create your first App

Let’s create a brand new console app utilizing the command:

dotnet new console -o MyApp -f net6.0

In the above command, MyApp is the undertaking listing’s title that we’re utilizing to retailer all required information to develop an utility, whereas net6.0 is the model of Dotnet we’re utilizing to create an app.

Switch to create a listing:

cd Myapp

Create your first App using Dotnet on Almalinux

Now, there’s already a demo program contained in the created undertaking listing known as program.cs, to run it use the command:

dotnet run

You will see output- “hello-world”

dotnet run app


5. How to uninstall

To take away Dotnet sooner or later when you don’t require it, use the DNF once more:

sudo dnf take away dotnet

Whereas for some explicit SDK or runtime model

sudo dnf take away dotnet-sdk-your-version
sudo dnf take away dotnet-runtime-your-version

For instance, if the model is 6.0 then the command will probably be:

sudo dnf take away dotnet-sdk-6.0

For extra info consult with the official documentation. 


Other Articles:

The Right Way to Install Lighttpd on AlmaLinux 8
The Right Way to Install Skype on Almalinux 8
Install PrestaShop on Almalinux 8
Command to Permanently Disable SELinux on AlmaLinux 




The Right Way to Install Docker on AlmaLinux 8

Previous article

The Right Way to Install Lighttpd on AlmaLinux 8

Next article

You may also like


Leave a Reply

More in Almalinux