skip to Main Content

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


  1. After downloading the package, during installation, you can see the installation path in the terminal
    May be try check directory: /usr/bin

    Login or Signup to reply.
  2. A simple search tells me, that the package aspnetcore-runtime-6.0 only have many .dlls 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 called dotnet 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.

    Login or Signup to reply.
  3. 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

    sudo apt remove dotnet6
    

    Then get the packages,

    wget https://packages.microsoft.com/config/ubuntu/22.10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
    sudo dpkg -i packages-microsoft-prod.deb
    rm packages-microsoft-prod.deb
    

    Install the SDK and runtime,

    sudo apt-get install -y dotnet-sdk-6.0
    sudo apt-get install -y dotnet-runtime-6.0
    

    These are just steps from the manual above and I hope it helps

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search