5

I try to download dotnet SDK for C# with

sudo apt-get install -y dotnet6

but it says

A fatal error occurred. The folder [/usr/lib/dotnet/dotnet6-6.0.110/host/fxr] does not exist
Shehzad
  • 66
  • 1
  • 6
  • 1
    The following may be helpful: [Install .NET on Linux](https://learn.microsoft.com/en-us/dotnet/core/install/linux) – Tu deschizi eu inchid Oct 23 '22 at 20:50
  • Is that one line the only output you get? If not, please add more output, preferably the entire output of the command if it's not too large. – Luke Woodward Oct 23 '22 at 21:10
  • there is an installation [script](https://stackoverflow.com/a/74588698/6482931) as a last resort situation. – Monsieur Merso Jan 11 '23 at 08:46
  • [The installation docs for 22.04](https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#2204) don't mention any `dotnet6` package. It's either `dotnet-sdk-6.0` for the full SDK or `dotnet-runtime-6.0` for the runtime and `aspnetcore-runtime-6.0` for ASP.NET Core applications. Did you follow the – Panagiotis Kanavos Jan 11 '23 at 08:51
  • 1
    Does this answer your question? [A fatal error occurred. The folder \[/usr/share/dotnet/host/fxr\] does not exist](https://stackoverflow.com/questions/73753672/a-fatal-error-occurred-the-folder-usr-share-dotnet-host-fxr-does-not-exist) – mamen Jan 16 '23 at 07:24

2 Answers2

4

This worked for me.

sudo apt remove dotnet*
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
sudo apt update
sudo apt install -y dotnet6
Ibrahim Timimi
  • 2,656
  • 5
  • 19
  • 31
0

If the Dotnet SDK is already installed on the system try the following it will help

sudo apt-get update 

then

sudo apt-get upgrade 

And if prompted yes or no choose yes for the .net framework otherwise if you don't know what you are doing choose no, that command is going to upgrade all your installed software and the kernel, so, be careful if you are relying on some old specific version of packages for your software to run

maybe it will ask you to restart

M.Ali El-Sayed
  • 1,608
  • 20
  • 23
  • 3
    apt upgrade is dangerous, don't – knocte Jan 12 '23 at 10:55
  • 1
    `sudo apt-get upgrade` is a 'guns on sparrows' approach for the given problem and does not guarantee to fix it. Please improve or delete your answer because it could lead to unwanted package-upgrades and possible further problems. – mamen Jan 16 '23 at 07:23