← All posts
May 6, 2020·2 min read

How to install DotNet Core in Manjaro Linux

A straightforward walkthrough for setting up .NET Core development on Manjaro (and Arch) Linux.

dotnetlinuxmanjarotutorial
How to install DotNet Core in Manjaro Linux

Originally posted on DEV.

I recently started picking up .NET Core again. I was a bit worried because I'm on a Linux operating system, and the state of .NET on Arch is not exactly stable. (Also the obligatory "btw I use arch" meme.) The process was mostly straightforward but required a little troubleshooting. Here is the result.

Installation

Install dotnet-sdk and dotnet-runtime from the Manjaro package manager GUI, or use the terminal. This should also work on vanilla Arch using pacaur instead of pacman:

pacman -S dotnet-sdk dotnet-runtime

Verify the installation and check where dotnet is located — the path matters for the next step:

$ dotnet --version
3.1.103
$ whereis dotnet
dotnet: /usr/bin/dotnet /usr/share/dotnet

Path Configuration

If the location of dotnet is not /usr/share/dotnet, create a new file at /etc/profile.d/dotnet.sh with the following content (requires sudo). After creating this file, reboot or re-login:

export DOTNET_ROOT=/opt/dotnet
export MSBuildSDKsPath=$DOTNET_ROOT/sdk/$(${DOTNET_ROOT}/dotnet --version)/Sdks
export PATH=${PATH}:${DOTNET_ROOT}

Then add the following to your ~/.bashrc (or ~/.zshrc if you use zsh):

# DOTNET - Required
export PATH="$PATH:/home/YOUR_USER_NAME/.dotnet/tools"
# DOTNET - Optional
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export ASPNETCORE_ENVIRONMENT=Development

You should now be ready to start developing .NET Core applications on Manjaro.