0

I have a problem.

I have newest raspbian, and I have installed .net core 2.1 on it, well everything looks fine until i reboot pi.

After reboot .net core command stops to work and i have to add

export DOTNET_ROOT=$HOME/dotnet 
export PATH=$PATH:$HOME/dotnet

then it will work.

Is there a way to make it permanent.

2
  • You can put those exports in /home/pi/.bashrc – Dougie Jan 31 '20 at 20:31
  • Where do you have do add the commands? – Ingo May 26 '20 at 12:17
1

Add

DOTNET_ROOT=$HOME/dotnet 
PATH=$PATH:$HOME/dotnet

to your ~/.profile or ~/.bashrc file.

0

Install it globaly, so any user can use it.

Helpful if one of your programm need to be run with root (sudo) ...

Here is my python install script (Update urls as you need :p ):

import os
def install_net_core():
  print("Downloading .net core SDK 3.1 ...")
  os.system('wget https://download.visualstudio.microsoft.com/download/pr/349f13f0-400e-476c-ba10-fe284b35b932/44a5863469051c5cf103129f1423ddb8/dotnet-sdk-3.1.102-linux-arm.tar.gz')

  print("Downloading Asp.net core runtime 3.1 ...")
  os.system('wget https://download.visualstudio.microsoft.com/download/pr/8ccacf09-e5eb-481b-a407-2398b08ac6ac/1cef921566cb9d1ca8c742c9c26a521c/aspnetcore-runtime-3.1.2-linux-arm.tar.gz')


  print("Extracting archive to /usr/share/dotnet ...")
  os.system('sudo mkdir -p /usr/share/dotnet')
  print("Extracting dotnet-sdk ...")
  os.system('sudo tar zxf dotnet-sdk-3.1.102-linux-arm.tar.gz -C /usr/share/dotnet')
  print("Extracting aspnetcore-runtime ...")
  os.system('sudo tar zxf aspnetcore-runtime-3.1.2-linux-arm.tar.gz -C /usr/share/dotnet')
  os.system('sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet')

  print("Removing archives ...")
  os.system('sudo rm -f dotnet-sdk-3.1.102-linux-arm.tar.gz')
  os.system('sudo rm -f aspnetcore-runtime-3.1.2-linux-arm.tar.gz')

  os.system('dotnet --info')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.