DEV Community

Cover image for How to install DotNet Core in Manjaro Linux
Kelvin Mai
Kelvin Mai

Posted on

How to install DotNet Core in Manjaro Linux

I recently started picking up .NET Core again. I was a bit worried because I'm on a linux operating system, and state of .NET is not exactly stable. (Also the obligatory "btw I use arch" meme). The process was pretty much straightforward but I still decided to do some troubleshooting. And here is the result.

Installation process

Install dotnet-sdk and dotnet-runtime from the Manjaro package manager GUI or you can use the following terminal command. I assume this will work on vanilla Arch as well using the pacaur command instead of pacman.

pacman -S dotnet-sdk dotnet-runtime

You can check if dotnet is installed by running the version command. And it will also be important to check where dotnet is running for reasons we'll get into later.

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

If the location of dotnet is not /usr/share/dotnet you will have to create a new file in /etc/profile.d/ with the following content as root so remember to use sudo. Doing this will require you to reboot or re-login. This note was found here.

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

Then finally in ~/.bashrc file add the following lines, ~/.zshrc if you're using zsh.

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

And now you should be ready to start developing .NET Core applications on your Manjaro linux machine.


Top comments (2)

dsschnau profile image
Dan Schnau

Hey Kelvin, thanks for typing this up. I'm playing with Manjaro Linux tonight.

I went to run my .net 5 app and got a weird error. It turned out there was one more package I needed to install to run ASP.NET applications.

pacman -S aspnet-runtime

More info at this Stack Overflow post:

rgarcia profile image
Robert D. Garcia

Nice post, worked perfect.