Fatal Error "The folder [/usr/share/dotnet/host/fxr] does not exist" when installing 3.1 on CentOS 8 with packages.microsoft.com repo enabled
Problem encountered on https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/install Operating System: CentOS8 Try to run "dotnet --list-sdks" it returns: A fatal error occurred. The folder [/usr/share/dotnet/host/fxr] does not exist** I have finished to run "sudo dnf install dotnet-sdk-3.1" command.
Please help.
Having the same issue, hopefully someone can clarify :)
OS CentOS Linux 8
Details
This happend after I fully removed all dotnet packages and reinstalled version 3.1 yum install dotnet-sdk-3.1. Every dotnet command crashes, not only 'dotnet --list-sdks'
@leecow @dagood is this something you can help with?
This can happen if dotnet-host and dotnet-hostfxr-3.1 are conflicting, try running this command:
dnf list installed | grep dotnet
dotnet-apphost-pack-3.1.x86_64 3.1.10-1.el8_3 @AppStream
dotnet-host.x86_64 5.0.1-1 @packages-microsoft-com-prod
dotnet-hostfxr-3.1.x86_64 3.1.10-1.el8_3 @AppStream
dotnet-runtime-3.1.x86_64 3.1.10-1.el8_3 @AppStream
dotnet-sdk-3.1.x86_64 3.1.404-1 @packages-microsoft-com-prod
dotnet-targeting-pack-3.1.x86_64 3.1.10-1.el8_3 @AppStream
dotnet-host from packages-microsoft-com-prod installs to /usr/share/dotnet/
dotnet-hostfxr from AppStream installs to /usr/lib64/dotnet/
Then, they can't find each other when you run dotnet --list-sdks. 🙁
If you do have packages-microsoft-com-prod, you should try cleaning up your dotnet packages, removing the repo, and trying another reinstall. Something like this:
sudo dnf remove -y packages-microsoft-prodsudo dnf autoremove -y dotnet-sdk-3.1sudo dnf install dotnet-sdk-3.1
You should make sure it's getting all the packages from AppStream and BaseOS, like this:
Dependencies resolved.
==================================================================================================
Package Arch Version Repository Size
==================================================================================================
Installing:
dotnet-sdk-3.1 x86_64 3.1.110-1.el8_3 AppStream 40 M
Installing dependencies:
aspnetcore-runtime-3.1 x86_64 3.1.10-1.el8_3 AppStream 6.2 M
aspnetcore-targeting-pack-3.1 x86_64 3.1.10-1.el8_3 AppStream 1.1 M
dotnet-apphost-pack-3.1 x86_64 3.1.10-1.el8_3 AppStream 73 k
dotnet-host x86_64 5.0.0-0.8.0201202git337413b.el8_3 AppStream 108 k
dotnet-hostfxr-3.1 x86_64 3.1.10-1.el8_3 AppStream 165 k
dotnet-runtime-3.1 x86_64 3.1.10-1.el8_3 AppStream 27 M
dotnet-targeting-pack-3.1 x86_64 3.1.10-1.el8_3 AppStream 2.0 M
dotnet-templates-3.1 x86_64 3.1.110-1.el8_3 AppStream 1.8 M
libicu x86_64 60.3-2.el8_1 BaseOS 8.8 M
lttng-ust x86_64 2.8.1-11.el8 AppStream 259 k
netstandard-targeting-pack-2.1 x86_64 5.0.100-0.8.0201202git337413b.el8_3 AppStream 1.5 M
userspace-rcu x86_64 0.10.1-2.el8 BaseOS 101 k
Then it should work.
For future reference: it's possible to reproduce the problem by setting up the packages.microsoft.com feed before installing:
$ sudo rpm -Uvh https://packages.microsoft.com/config/centos/8/packages-microsoft-prod.rpm
...
$ sudo dnf install dotnet-sdk-3.1
...
dotnet-host x86_64 5.0.1-1 packages-microsoft-com-prod 64 k
dotnet-hostfxr-3.1 x86_64 3.1.10-1.el8_3 AppStream 165 k
...
$ dotnet --list-sdks
A fatal error occurred. The folder [/usr/share/dotnet/host/fxr] does not exist
We have an issue tracking documenting this at https://github.com/dotnet/docs/issues/18347. (It is also possible to configure the repos so you can keep using both without this conflict, but normally you shouldn't need to do that: https://github.com/dotnet/core/issues/5212#issuecomment-714542560)
I accidentally hit some unknown hotkey and posted that before I meant to, sorry--added some edits with a little more context.
I also renamed the issue to make it more specific. I'm 99% sure this repo conflict is the cause of the problem (I expected these conflicts to start popping up), but feel free to rename the issue back to something different and let me know if that isn't it.
I had a similar issue. I removed the Microsoft repos and all it's packages and got everything straight from Fedora repos. I run Fedora 33. https://bugzilla.redhat.com/show_bug.cgi?id=1847206
This seems answered. Please reopen if not.
annot stat '/mnt/nfs_share/edm_yocto/build-xwayland-edm-g-imx8mp/tmp/work/aarch64-poky-linux/dotnet/5.0.300-r0/dotnet-5.0.300/host/fxr/gnu': No such file or directory
Is happening on a fresh install with no dotnet packages
Hello guys I have the same problem, but my RPI does not seem to find sudo dnf, hopefully someone can clarify :)
I had dotnet installed from https://packages.microsoft.com/ubuntu/20.04/prod , and then also from the Ubuntu repository dotnet6 package. My dotnet-host had upgraded to version 7, but my other dotnet packages were version 6.0. I was getting the error:
$ dotnet --version
A fatal error occurred. The folder [/usr/share/dotnet/host/fxr] does not exist
It was fixed by removing my dotnet* packages, turning off the packages.microsoft.com/ package repo, and installing dotnet6.
$ dotnet --version
6.0.111
(This is no doubt documented elsewhere, but in case anyone else is looking at this thread for a solution.)
EhabBen10: You may need to use sudo apt depending on what your machine is using for package management.
Just faced the same issue on an Ubuntu 22.04 machine. However, I didn't have any Microsoft packages installed, so I don't know how could this issue have appeared. Nevertheless, it got fixed by a simple sudo apt update && sudo apt upgrade -y.
Tried all the above - nothing worked
I used these instructions and it works!