Home > Enterprise >  Installing .NET SDK via the dotnet-install script on Arch Linux
Installing .NET SDK via the dotnet-install script on Arch Linux

Time:03-08

I am running Arch Linux and I wish to install the .NET 6.0 SDK via the dotnet-install script.

I've changed permissions on the script to make it an executable I then ran:

./dotnet-install.sh --channel LTS

Here is the output:

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 6.0.102 is already installed.
dotnet-install: Adding to current process PATH: `/home/j/.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.

Notice how it says SDK version 6.0.102 is already installed.

However when I then run:

~/programs ❯ dotnet --list-sdks    
~/programs ❯ 

I get no output as you can see, but when running:

~/programs ❯ dotnet --list-runtimes
Microsoft.AspNetCore.App 6.0.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
~/programs ❯ 

I get the runtimes listed.

What's going on here? When I try to build code, I get:

~/code/mechanic360.api main ❯ dotnet build .        
Could not execute because the application was not found or a compatible .NET SDK is not installed.
Possible reasons for this include:
  * You intended to execute a .NET program:
      The application 'build' does not exist.
  * You intended to execute a .NET SDK command:
      It was not possible to find any installed .NET SDKs.
      Install a .NET SDK from:
        https://aka.ms/dotnet-download
~/code/mechanic360.api main ❯    

As you can see, it can't find the SDK. What am I missing?

CodePudding user response:

Had the same problem out of nowhere. Was able to fix it with this steps https://docs.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install

after this i relocated my dotnet location to "/home/"username"/.dotnet/dotnet" and i was ready to build.

  • Related