fsharp.org icon indicating copy to clipboard operation
fsharp.org copied to clipboard

Use F# on Linux instructions did not work

Open ScottHutchinson opened this issue 4 years ago • 6 comments

https://github.com/fsharp/fsfoundation/blob/gh-pages/use/linux/index.md#option-1-install-the-cli-tools-and-use-your-own-editor

Following these instructions in WSL2 resulted in:

scott@xx:/mnt/c/Users/hutchinsons$ dotnet --info
dotnet: command not found
scott@xx:/mnt/c/Users/hutchinsons$ whereis dotnet
dotnet: /mnt/c/Program Files/dotnet/dotnet.exe /mnt/c/Program Files (x86)/dotnet/dotnet.exe
scott@xx:/mnt/c/Users/hutchinsons$ /mnt/c/Program Files/dotnet/dotnet --info
-bash: /mnt/c/Program: No such file or directory
scott@xx:/mnt/c/Users/hutchinsons$

@cartermp

ScottHutchinson avatar Oct 21 '21 21:10 ScottHutchinson

Which instructions?

cartermp avatar Oct 21 '21 22:10 cartermp

The ones the link points to.

ScottHutchinson avatar Oct 21 '21 22:10 ScottHutchinson

curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel Current

ScottHutchinson avatar Oct 21 '21 22:10 ScottHutchinson

This is what I use (well, contributed) to gitpod to install and provision docker images with the right .NET installed. Works in those environments, which are proper linux and not WSL. So I'm not sure what else to do here.

The alternative is to follow the existing link on those pages, which eventually brings you here: https://docs.microsoft.com/en-us/dotnet/core/install/linux

As you can see, there's no real one-size-fits-all for linux installs unless you use the dotnet-install script.

cartermp avatar Oct 21 '21 23:10 cartermp

Ah, actually, I wonder if DOTNET_ROOT needs to get set? IIRC the default path is $HOME/.dotnet and so DOTNET_ROOT=/$HOME/.dotnet might be needed?

cartermp avatar Oct 21 '21 23:10 cartermp

The script seems to have created the .dotnet folder in the working directory instead of the user's home directory on Linux. The working directory was my user folder in Windows (/mnt/c/Users/hutchinsons). I'm not sure whether that .dotnet folder was already there and whether I need it on Windows; otherwise I would delete it and try again with my Linux home directory as the working directory.

ScottHutchinson avatar Oct 25 '21 15:10 ScottHutchinson