How to Install .NET 8 on Rocky Linux 9

Introduction

.NET is a popular free, cross-platform, open-source developer platform for building many different types of applications. With .NET, you can use multiple languages, editors, and libraries to build for web, mobile, desktop, games, and IoT. This guide will walk you through the steps to install .NET 8 on Rocky Linux 9.

Prerequisites

  • A machine running Rocky Linux 9.
  • Apache Installed
  • Sudo or root access on the machine.

Step-by-Step Installation Guide

Step 1: Update Your System

Before installing any new package, it’s a good practice to update your system’s package index. Open a terminal and run:

sudo dnf -y update

Step 2: Install Microsoft’s Package Signing Key

Microsoft provides a package repository for Linux distributions, which includes .NET. To ensure authenticity and integrity of the packages, first install Microsoft’s package signing key:

sudo rpm -Uvh https://packages.microsoft.com/config/centos/8/packages-microsoft-prod.rpm

Step 3: Install .NET SDK or Runtime

Depending on your needs, you can install either the .NET Software Development Kit (SDK) for development purposes or the .NET Runtime for running applications.

Install the .NET ASP CORE:

dnf install aspnetcore-runtime-8.0

Install the .NET SDK:

To develop .NET applications, you’ll need the SDK. Install it using:

sudo dnf install dotnet-sdk-8.0

Install the .NET Runtime:

If you only need to run .NET applications, the runtime is sufficient. Install it using:

sudo dnf install dotnet-runtime-8.0

Step 4: Verify the Installation

After the installation, verify it by checking the installed .NET version:

dotnet --info

This command will display detailed information about the installed .NET SDK and runtime versions.

Step 5: Start Developing!

With .NET 8 installed, you’re all set to start developing applications on Rocky Linux 9. You can begin by creating a new application or running an existing one.

Conclusion

Installing .NET 8 on Rocky Linux 9 is straightforward. Whether you’re developing .NET applications or just need to run them, the steps above will help you set up your environment efficiently. Happy coding!