#RaspberryPi – How to solve #dotnet core not recognized after reboot

Buy Me A Coffee

Hi!

So, after writing my posts on how to install dotnet core 3.1 on a Raspberry Pi 4, I found that after I reboot my device, the dotnet command stop working. When I run dotnet from bash I get the following message

~bash: dotnet: command not found

dotnet command not found

The problem, is that the export steps of the installation process were lost after the reboot. And, as reminder of what is the export command.

Linux export command is use to set export attribute for shell variables on Linux system. The Linux export command is one of bash shell built in command.

In order to fix this, we can add the commands into our [~/.bashrc] file. First we need to edit our file with the command

sudo nano ~/.bashrc

And add the lines

export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet
export PATH="$PATH:/home/pi/.dotnet/tools"
raspberry pi 4 edit bashrc to add dotnet core wrapper

Now we need to reload the [~/.bashrc] file with the command

source ~/.bashrc
dotnet command working after reload bash file

And that’s it ! if the command is not recognized, just reload the bashrc file.

Happy coding!

Greetings @ Burlington

El Bruno

My posts on Raspberry Pi ⚑🐲⚑

Dev posts for Raspberry Pi
Tools and Apps for Raspberry Pi
Setup the device
Hardware

Advertisement

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: