0

I downloaded ./dotnet-install.sh and successfully installed:

$ ./dotnet-install.sh -c Current
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.

dotnet-install: .NET Core SDK version 5.0.207 is already installed.
dotnet-install: Adding to current process PATH: `/home/tesla/.dotnet`. Note: This change will be visible only when sourcing script.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://docs.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.

I added path

└─$ export PATH=$PATH:/home/tesla/.dotnet

dotnet --version 5.0.207

I have two issues:

First, everytime I restart the PC, I need to reinstall Second vs code terminal does not see dotnet --version command:

"Command 'dotnet' not found, but can be installed with:
sudo snap install dotnet-sdk   # version 5.0.401, or
sudo apt  install dotnet-host
See 'snap info dotnet-sdk' for additional versions. "

If I set the path on vscode terminal, after re staring the vscode, it does not recognize dotnet command

2 Answers 2

1

You need to add your PATH to your ~/.profile or ~/.bashrc file.

PATH=$PATH:/home/tesla/.dotnet

To update the changes immediately

source ~/.profile 
or
source ~/.bashrc
0

You can manually install dotnet :

1- By installing the tarball:

wget https://dotnetcli.azureedge.net/dotnet/Sdk/5.0.207/dotnet-sdk-5.0.207-linux-x64.tar.gz
sudo mkdir -p /usr/share/dotnet
sudo tar -zxf dotnet-sdk-5.0.207-linux-x64.tar.gz -C /usr/share/dotnet
sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet

2- By installing the .deb file

You can download the .deb file from here, e,g:

wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.