Skip to content

zsh: command not found: dotnet on Arch Linux #4322

New issue

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

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

Already on GitHub? # to your account

Closed
AzimovParviz opened this issue Feb 26, 2020 · 7 comments
Closed

zsh: command not found: dotnet on Arch Linux #4322

AzimovParviz opened this issue Feb 26, 2020 · 7 comments
Labels
area-setup Issues related to installing .NET Core needs-more-info Not enough information has been provided. Please share more detail as requested.

Comments

@AzimovParviz
Copy link

AzimovParviz commented Feb 26, 2020

Issue Title

After countless reinstalls trying different binaries from AUR I tried to install the precise version I needed manually but didn't really understand how it works and ended up just rm the dotnet executable from /usr/bin. Now when trying to install sdk from AUR again, I end up with the error from the title

General


╰─$ dotnet --version
zsh: command not found: dotnet

╰─$ whereis dotnet                                                                                            127 ↵
dotnet: /usr/local/bin/dotnet /usr/share/dotnet

╰─$ which dotnet
dotnet not found
╰─$ file dotnet
dotnet: broken symbolic link to /usr/local/share/dotnet/dotnet

I have tried fixing the broken syslink with the

sudo ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/

but it just creates a broken link anyways

@omajid
Copy link
Member

omajid commented Feb 26, 2020

cc @alucryd @Saancreed

Sounds like a mix of AUR packages and Microsoft packages and they dont play nice with each other. I dont use Arch, so I dont know of the step-by-step fix.

@alucryd
Copy link

alucryd commented Feb 26, 2020

@AzimovParviz What exactly are you trying to achieve? The latest dotnet runtime and sdk are in the official repos. As long as dotnet-host from the repositories is installed, you can theoretically install and use any runtime or sdk from AUR (if they follow the same layout as our official packages), but you'll always need at least dotnet-host, which provides /usr/bin/dotnet.

BTW please don't randomly delete or create files from/on your filesystem, linux has package managers, you'll make them very upset.

@scalablecory scalablecory added the area-setup Issues related to installing .NET Core label Feb 26, 2020
@scalablecory
Copy link
Contributor

Can you list step by step how you're installing .NET Core?

@scalablecory scalablecory added the needs-more-info Not enough information has been provided. Please share more detail as requested. label Feb 26, 2020
@AzimovParviz
Copy link
Author

@AzimovParviz What exactly are you trying to achieve? The latest dotnet runtime and sdk are in the official repos. As long as dotnet-host from the repositories is installed, you can theoretically install and use any runtime or sdk from AUR (if they follow the same layout as our official packages), but you'll always need at least dotnet-host, which provides /usr/bin/dotnet.

BTW please don't randomly delete or create files from/on your filesystem, linux has package managers, you'll make them very upset.

I misunderstood how dotnet works and passed dll to the "dotnet run" command and it told me to have the particular version of the framework installed for the program i was trying to run.

Can you list step by step how you're installing .NET Core?

pacman -Syu dotnet-sdk
and also tried
yay -S donetn-sdk-bin and yay -S dotnet-sdk-preview

@AzimovParviz
Copy link
Author

Can you list step by step how you're installing .NET Core?
https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-3.1.102-linux-x64-binaries

also I used this guide (but for another dotnet version) as well. After I messed up installing runtime, I deleted the executable from the usr/bin folder and messed up everything

@Saancreed
Copy link

Saancreed commented Mar 3, 2020

pacman -Syu dotnet-sdk

That should do it. If you have ever deleted some files related to one of dotnet packages then try reinstalling all of them with pacman -Syu dotnet-host dotnet-runtime dotnet-sdk. After that you should have /usr/bin/dotnet as a symlink to /usr/share/dotnet/dotnet binary (both files are owned by dotnet-host package). Also make sure you don't have some broken dotnet stuff in /usr/local, because it will conflict with packages.

And if you need some other version of .NET Core, then dotnet-{runtime,sdk}-{2.1,3.0} from AUR should integrate nicely with dotnet-host from official Arch repo.

(Although dotnet-sdk-3.0 will conflict with dotnet-sdk because of duplicated netstandard targeting pack that exists in both packages.)

@AzimovParviz
Copy link
Author

pacman -Syu dotnet-sdk

That should do it. If you have ever deleted some files related to one of dotnet packages then try reinstalling all of them with pacman -Syu dotnet-host dotnet-runtime dotnet-sdk. After that you should have /usr/bin/dotnet as a symlink to /usr/share/dotnet/dotnet binary (both files are owned by dotnet-host package). Also make sure you don't have some broken dotnet stuff in /usr/local, because it will conflict with packages.

And if you need some other version of .NET Core, then dotnet-{runtime,sdk}-{2.1,3.0} from AUR should integrate nicely with dotnet-host from official Arch repo.

(Although dotnet-sdk-3.0 will conflict with dotnet-sdk because of duplicated netstandard targeting pack that exists in both packages.)

installing all 3 together helped, it seems to work now, thank you a lot

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area-setup Issues related to installing .NET Core needs-more-info Not enough information has been provided. Please share more detail as requested.
Projects
None yet
Development

No branches or pull requests

5 participants