I installed .NET 6 on my ubuntu machine version 22.10 using the snap package manager. I’m wanting to create a web api core project using aspnetcore, but was having issues with linux asp.net core segmentation fault (core dumped) errors so I removed the snap version and installed it using sudo apt-get install -y aspnetcore-runtime-6.0.
However now when I run dotnet –info I get bash: /snap/bin/dotnet: No such file or directory. There is a dotnet directory inside /etc, but it only shows two files: install_location_x64 and install_location. Is there a step I’m missing? Or is a reliable way to install .NET 6, specifically the aspnetcore runtime and sdk so I can build the web api project?
3
Answers
After downloading the package, during installation, you can see the installation path in the terminal
May be try check directory:
/usr/bin
A simple search tells me, that the package
aspnetcore-runtime-6.0
only have many.dll
s of ASP .NET Core under/usr/lib/dotnet/dotnet6-6.0.110/shared/Microsoft.AspNetCore.App/6.0.10/
.But it has a transitive on
dotnet-host
, which has an executable calleddotnet
under/usr/lib/dotnet/dotnet6-6.0.110/
, and,/usr/lib/dotnet/dotnet
, if you download the package and dive into it.So, you may find the
dotnet
executable there.For the
bash: /snap/bin/dotnet: No such file or directory
thing, you may check your$PATH
environment variable first.Every time I encounter problem packages for a particular OS, I just check their official docs. Found this handy manual that details out the steps
Seems like it’s also recommended to remove preview and/or previous versions before a fresh install
Then get the packages,
Install the SDK and runtime,
These are just steps from the manual above and I hope it helps