Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #5746

Closed
alexstonehs opened this issue Dec 14, 2020 · 12 comments
Labels
area-setup Issues related to installing .NET Core area-tutorials Issues related to getting started tutorials

Comments

@alexstonehs
Copy link

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.

@rob-alma
Copy link

rob-alma commented Dec 15, 2020

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'

@mairaw
Copy link
Contributor

mairaw commented Jan 8, 2021

@leecow @dagood is this something you can help with?

@mairaw mairaw added area-setup Issues related to installing .NET Core area-tutorials Issues related to getting started tutorials labels Jan 8, 2021
@dagood
Copy link
Member

dagood commented Jan 8, 2021

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:

  1. sudo dnf remove -y packages-microsoft-prod
  2. sudo dnf autoremove -y dotnet-sdk-3.1
  3. sudo 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 dotnet/docs#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: #5212 (comment))

@dagood dagood changed the title Fatal Error 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 Jan 8, 2021
@dagood
Copy link
Member

dagood commented Jan 8, 2021

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.

@andreiuipath
Copy link

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

@danmoseley
Copy link
Member

This seems answered. Please reopen if not.

@tbandtg
Copy link

tbandtg commented Jun 10, 2021

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

@EhabBen10
Copy link

Hello guys
I have the same problem, but my RPI does not seem to find sudo dnf, hopefully someone can clarify :)

@marksvc
Copy link

marksvc commented Dec 7, 2022

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.

@dot-sent
Copy link

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.

@wgrs
Copy link

wgrs commented Feb 21, 2023

Tried all the above - nothing worked

@mhesari20
Copy link

I used these instructions and it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-setup Issues related to installing .NET Core area-tutorials Issues related to getting started tutorials
Projects
None yet
Development

No branches or pull requests