core icon indicating copy to clipboard operation
core copied to clipboard

Not able to run .NET 6 SDK

Open uniprogr opened this issue 3 years ago • 4 comments

Problem encountered on https://dotnet.microsoft.com/en-us/learn/dotnet/hello-world-tutorial/intro Operating System: Linux, Ubuntu 20.04

Installed .NET 6 from hello world tutorial, followed all the instructions but system cannot detect .net when I type in the 'dotnet' command in the terminal. I get this error:

cannot exec "/snap/dotnet-sdk/174/snap/command-chain/snapcraft-runner": permission denied

It does work when I give permission using sudo, but can I program does it function properly with this permission problem?

uniprogr avatar Jul 23 '22 04:07 uniprogr

It is caused because of improper installation. Reinstall dotnet 6.0

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

then install runtime

sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y aspnetcore-runtime-6.0

Reference

pratikkabade avatar Jul 25 '22 03:07 pratikkabade

I had a similar problem and solved it by doing following:

https://stackoverflow.com/a/70931715/3855642

Essentially, remove the existing symlink and create a new one.

sudo rm /usr/local/bin/dotnet
sudo ln -s /snap/dotnet-sdk/current/dotnet /usr/local/bin/dotnet

Fighter19 avatar Jul 28 '22 23:07 Fighter19

Thanks man! Will attempt on Monday when I'm back in the office

On Thu, Jul 28, 2022, 4:25 PM Fighter19 @.***> wrote:

I had a similar problem and solved it by doing following:

https://stackoverflow.com/a/70931715/3855642

Essentially, remove the existing symlink and create a new one.

sudo rm /usr/local/bin/dotnet sudo ln -s /snap/dotnet-sdk/current/dotnet /usr/local/bin/dotnet

— Reply to this email directly, view it on GitHub https://github.com/dotnet/core/issues/7627#issuecomment-1198720741, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQGR5P4347DA36KKX5EPMYLVWMJHDANCNFSM54NMMV6A . You are receiving this because you commented.Message ID: @.***>

Dylanthemachine avatar Jul 28 '22 23:07 Dylanthemachine

https://github.com/dotnet/core/issues/7634#issuecomment-1198899296

ceksudo avatar Jul 29 '22 06:07 ceksudo

This particular issue should be resolved in snap installs.

leecow avatar Jun 09 '23 22:06 leecow