How to Install .NET Core SDK on Fedora

The .NET SDK provides everything you need to build, run, and publish applications across multiple platforms. Whether you are developing web applications with ASP.NET Core, building command-line tools, or creating cross-platform desktop applications, this guide walks you through installing the .NET SDK on Fedora Linux. By the end, you will have a working .NET development environment, verified with a test application, and you will understand how to manage multiple SDK versions.

Choose Your .NET SDK Installation Method

Fedora offers two primary ways to install the .NET SDK. The DNF method provides automatic updates and system integration, while the installer script gives you fine-grained control over versions and installation locations.

MethodChannelVersionsUpdatesBest For
DNF Package ManagerFedora Repos.NET 8.0 LTS, 10.0 LTSAutomatic via dnf upgradeMost users who want system-managed updates
Installer ScriptMicrosoftAny release (LTS, STS, previews)Manual re-run of scriptDevelopers needing specific versions or multiple SDKs side-by-side

For most users, the DNF method is recommended because it integrates with system updates and requires no manual PATH configuration. Use the installer script only if you need a specific version not available in Fedora repositories or want to install .NET in your home directory without root access.

Understanding .NET Version Support

Microsoft releases a new .NET version each November and follows a predictable support policy. Even-numbered releases (.NET 8, 10, 12) receive Long Term Support (LTS) with three years of security patches and bug fixes. Odd-numbered releases (.NET 9, 11) receive Standard Term Support (STS) for 18 months. This predictable cadence helps teams plan migrations and maintain stable production environments.

VersionSupport TypeRelease DateEnd of SupportRecommendation
.NET 10.0LTSNovember 2025November 2028Recommended for new projects
.NET 9.0STSNovember 2024May 2026Migrate to .NET 10.0 before EOL
.NET 8.0LTSNovember 2023November 2026Stable choice for existing applications

For detailed information about Microsoft’s support lifecycle and servicing policies, see the official .NET support policy documentation.

Which version should you choose? For new projects, install .NET 10.0 to benefit from the latest performance improvements and three years of support. If you are maintaining an existing .NET 9.0 application, plan your migration to .NET 10.0 before May 2026. Projects still on .NET 8.0 can remain there until November 2026, though upgrading to .NET 10.0 provides access to new features and a longer support window.

Install .NET SDK on Fedora via DNF

Update Your System

First, refresh your system’s package cache and apply any pending updates. This step ensures you install the latest available .NET SDK version and avoid dependency conflicts.

sudo dnf upgrade --refresh

Search for Available .NET SDK Versions

Fedora’s default repositories include multiple .NET SDK versions. To see what is currently available, run the following search command:

dnf search dotnet-sdk

On Fedora 43, this command displays the following SDK packages:

Matched fields: name
 dotnet-sdk-10.0.x86_64 .NET 10.0 Software Development Kit
 dotnet-sdk-8.0.x86_64  .NET 8.0 Software Development Kit
 dotnet-sdk-9.0.x86_64  .NET 9.0 Software Development Kit

The output shows .NET 8.0 (LTS), 9.0 (STS, supported until May 2026), and 10.0 (current LTS) are available. While .NET 9.0 packages remain in the repositories, new projects should use .NET 10.0, and existing 9.0 projects should plan migration before the May 2026 end-of-life date. Additional packages like dotnet-sdk-aot-* provide Ahead-of-Time compilation support, and dotnet-sdk-dbg-* packages contain debug symbols.

Install the .NET SDK

Install the .NET 10.0 SDK (current LTS release) with the following command:

sudo dnf install dotnet-sdk-10.0 -y

This installs the complete SDK along with the .NET runtime and ASP.NET Core runtime as dependencies. Alternatively, if you need to maintain compatibility with the previous LTS:

sudo dnf install dotnet-sdk-8.0 -y

Install Runtime Only (Optional)

If you only need to run .NET applications without developing them, you can install just the runtime instead of the full SDK. This is common on production servers or when deploying applications to machines that do not need build tools. The runtime is significantly smaller than the SDK, using approximately 70 MB compared to 330 MB for the full SDK.

The base .NET runtime runs console applications and background services:

sudo dnf install dotnet-runtime-10.0 -y

The ASP.NET Core runtime includes the base runtime plus additional libraries for hosting web applications, APIs, and services:

sudo dnf install aspnetcore-runtime-10.0 -y

If you are unsure which to install, the SDK is recommended for development machines since it includes everything. For production deployment, choose the runtime that matches your application type.

Verify the Installation

After installation, verify that the .NET SDK is accessible from your terminal by checking the installed version:

dotnet --version
10.0.101

Additionally, you can see all installed SDKs and their locations:

dotnet --list-sdks
10.0.101 [/usr/lib64/dotnet/sdk]

Similarly, you can view all installed runtimes:

dotnet --list-runtimes
Microsoft.AspNetCore.App 10.0.1 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 10.0.1 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]

This output confirms both the base .NET runtime and the ASP.NET Core runtime are installed and ready for use.

Install .NET SDK via Microsoft Installer Script

The official .NET installer script from Microsoft provides an alternative installation method. This approach is particularly useful when you need a specific SDK version, want to install .NET in your home directory without root privileges, or need to maintain multiple SDK versions side-by-side for different projects.

Download the Installer Script

First, download the script from Microsoft’s servers:

wget https://dot.net/v1/dotnet-install.sh

Next, make the script executable:

chmod +x ./dotnet-install.sh

Run the Installer

To install the latest LTS version of .NET (currently .NET 10.0), run the script without arguments:

./dotnet-install.sh

The script downloads and installs .NET to ~/.dotnet by default. You will see output similar to:

dotnet-install: Attempting to download using primary link https://builds.dotnet.microsoft.com/dotnet/Sdk/10.0.101/dotnet-sdk-10.0.101-linux-x64.tar.gz
dotnet-install: Extracting archive from https://builds.dotnet.microsoft.com/dotnet/Sdk/10.0.101/dotnet-sdk-10.0.101-linux-x64.tar.gz
dotnet-install: Adding to current process PATH: "/home/user/.dotnet".
dotnet-install: Installation finished successfully.

If you need the previous LTS version (.NET 8.0) instead, specify that channel:

./dotnet-install.sh --channel 8.0

Alternatively, you can request a specific major version explicitly:

./dotnet-install.sh --channel 10.0

For deployment scenarios where you only need to run applications without developing them, install just the runtime:

./dotnet-install.sh --channel 10.0 --runtime aspnetcore

Configure Environment Variables

When installed via the script, .NET is placed in ~/.dotnet and requires PATH configuration. Add the following lines to your shell configuration file (~/.bashrc for Bash):

echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.bashrc
echo 'export PATH=$PATH:$DOTNET_ROOT' >> ~/.bashrc

To apply the changes immediately without opening a new terminal, reload the configuration file:

source ~/.bashrc

Alternatively, open a new terminal window for the changes to take effect automatically.

Verify the Script Installation

Confirm the installation by checking the version:

dotnet --version

The output should display the installed SDK version number, confirming .NET is accessible from your PATH.

Test Your .NET Installation

Creating and running a test application confirms your .NET SDK is working correctly. In this section, we walk through building both a console application and an ASP.NET Core web application.

Create and Run a Console Application

First, create a new console application project:

dotnet new console -n HelloWorldApp

The dotnet new command generates a project structure with the necessary files. Then, navigate to the project directory and run the application:

cd HelloWorldApp
dotnet run

On the first run, you will see the .NET welcome message followed by the application output:

Welcome to .NET 10.0!
---------------------
SDK Version: 10.0.101

Restore succeeded.

Hello, World!

The “Hello, World!” output confirms your SDK can compile and execute .NET applications successfully.

Create and Run an ASP.NET Core Web Application

Next, verify ASP.NET Core functionality by creating a web application using the MVC template:

dotnet new mvc -n HelloWorldWebApp
cd HelloWorldWebApp
dotnet run

Once the build completes, the application starts and displays URLs where it is listening:

Building...
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.

Then, open a web browser and navigate to http://localhost:5000 to see the default ASP.NET Core welcome page. Press Ctrl+C in the terminal to stop the application.

Manage .NET SDK Versions

Fedora allows installing multiple .NET SDK versions simultaneously, which is useful when different projects require different .NET versions.

Install Multiple SDK Versions

For example, to install both the current and previous LTS versions:

sudo dnf install dotnet-sdk-8.0 dotnet-sdk-10.0 -y

Once installed, verify both are available:

dotnet --list-sdks
8.0.424 [/usr/lib64/dotnet/sdk]
10.0.101 [/usr/lib64/dotnet/sdk]

Select a Specific SDK Version for a Project

By default, dotnet uses the highest installed SDK version. However, to pin a specific version for a project, create a global.json file in the project directory:

dotnet new globaljson --sdk-version 8.0.424

This command creates a global.json file that instructs the .NET CLI to use the specified SDK version when working in that directory.

Update the .NET SDK

When installed via DNF, .NET receives updates through standard system upgrades. To update all installed .NET packages:

sudo dnf upgrade --refresh 'dotnet*' 'aspnetcore*'

In contrast, for script-based installations, download and run the installer script again with the same channel to get the latest version.

Disable .NET Telemetry (Optional)

The .NET SDK collects anonymous usage data by default to help Microsoft improve the tools. If you prefer not to share this data, you can disable telemetry by setting an environment variable.

To disable it, add the following line to your shell configuration:

echo 'export DOTNET_CLI_TELEMETRY_OPTOUT=1' >> ~/.bashrc
source ~/.bashrc

Next, verify the setting is applied:

echo $DOTNET_CLI_TELEMETRY_OPTOUT
1

An output of 1 confirms telemetry is now disabled for all future .NET CLI operations.

Troubleshoot Common .NET Issues

Command Not Found After Installation

If you installed .NET via the script and receive “command not found” errors, the PATH environment variable is not configured correctly. Verify your shell configuration includes the .NET path:

echo $PATH | grep -q ".dotnet" && echo "PATH configured" || echo "PATH missing .dotnet"

If the PATH is missing, add the configuration and reload your shell:

echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.bashrc
echo 'export PATH=$PATH:$DOTNET_ROOT' >> ~/.bashrc
source ~/.bashrc

SDK Version Mismatch Errors

Sometimes when opening a project, you may see an error like:

The specified SDK version "8.0.100" cannot be found.

This error occurs when a project’s global.json requests a specific SDK version that is not installed. First, check the required version:

cat global.json

Then install the required SDK version or update global.json to use an installed version.

Restore Fails with Network Errors

If dotnet restore fails with network errors, verify your internet connection and NuGet access:

curl -I https://api.nuget.org/v3/index.json

A successful response returns HTTP 200. However, if your network uses a proxy, configure it in your environment or NuGet configuration file.

Remove .NET SDK from Fedora

If you need to remove the .NET SDK, the process depends on how it was installed.

Remove DNF-Installed .NET

To remove a specific SDK version installed via DNF:

sudo dnf remove dotnet-sdk-10.0 -y
sudo dnf autoremove -y

Additionally, the autoremove command cleans up orphaned dependencies that were installed alongside the SDK.

Alternatively, to remove all .NET packages from your system:

sudo dnf remove 'dotnet*' 'aspnetcore*' 'netstandard*' -y
sudo dnf autoremove -y

Finally, verify removal by confirming the dotnet command is no longer available:

which dotnet

If the command is still found, it may be from a script-based installation that needs separate removal.

Remove Script-Installed .NET

If you installed .NET using the installer script instead, remove it by deleting the installation directory and cleaning up environment variables.

The following command permanently deletes the .NET installation directory and all SDKs/runtimes within it. Any global tools or custom configurations in this directory will also be removed.

rm -rf ~/.dotnet

Next, remove the environment variable exports from your shell configuration. Edit ~/.bashrc and delete the lines containing DOTNET_ROOT and the PATH modification for .dotnet.

Conclusion

You now have a working .NET development environment on Fedora, ready for building web applications, console tools, and cross-platform software. With DNF package management, your SDK receives security updates automatically, and the version management tools covered in this guide let you maintain multiple SDKs for different projects. For additional guidance, explore the official .NET documentation.

Leave a Comment