dotnet not being recognized in Ubuntu 22.4 LTS container During Scripted Install
I attempted to perform a scripted Install of dotnet in my Ubuntu 22.04 LTS container on my windows 11 PC using the instructions on this page https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install. I ran the script and no problems arised, then i installed all the required dependances for dotnet on Ubuntu https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#dependencies based on this list. The problem is that running
dotnet --version yields the following error (figure 1) if i run the dotnet-install.sh script again (figure 2). apparently its already installed but isn't recognized.
Upon inspecting the $PATH variable in my Ubuntu container I realized .dotnet was installed inside mnt/c/Users/User/ directory which i believe is outside my container environment and instead inside my windows 11 environment.
I tried readding the systemwide path as the following piece of documentation suggests
https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#set-environment-variables-system-wide
(figure 4) (figure 5)
however this yielded the same results as before
(figure 6)
I wish i could figure out how to get the script install to work because I'm invested on this approach but I recognize that simply using the Ubuntu feed would be easier. The reason i wanted to try the scripted install method was because I got the following message
(figure 7)
but after looking into
https://github.com/dotnet/core/issues/4378
I'm curious as to what system resources the --classic flag requires? just for curiosity
GitHub
this revision of snap "dotnet-sdk" was published using classic conf...
Problem encountered on https://dotnet.microsoft.com/learn/aspnet/hello-world-tutorial/install Operating System: linux Provide details about the problem you're experiencing. Include your operati...
.NET and Ubuntu overview - .NET
Learn about the ways you can install .NET on Ubuntu, either from the built-in package feed, the .NET backports repository, or the Microsoft repository.
Install .NET on Linux without using a package manager - .NET
Demonstrates how to install the .NET SDK and the .NET Runtime on Linux without a package manager. Use the install script or manually extract the binaries.
3 Replies
of course just downloading from the ubuntu feed solved my problem :catfacepalm:
but why didnt the scripted install not work?
A problem that arose as a result of me using snap is that im unable to use the dotnet update workload command
i believe snap was designed to only give read only acess to packages and installing using the --classic flag only allows my dotnet package to read and write outside of the snap directory. however inorder to use dotnet workload update i need write permission in my package. i tried using chmod to change the permissions on metadata however i still got the same error
installing dotnet using the microsoft feed fixed my issue if anyone had similar problems