Permision denied for dotnet

Viewed 2543

I recently installed dotnet 5.0 on Pop OS but whenever I try to use it it says that I don't have permission.

For example, if I just try to run the command dotnet it gives the the message

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

When I run the command as the root user it works perfectly fine.

I don't know if this is because I installed dotnet as a snap package

2 Answers

I had the same issue and unfortunately the dotnet issue page was not working.

To fix this issue I had to install the package with apt instead of snap.

sudo snap remove dotnet-sdk // if needed

wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb

sudo dpkg -i packages-microsoft-prod.deb

sudo apt update

sudo apt install apt-transport-https

sudo apt-get install -y dotnet-sdk-5.0

Remove snap first sudo snap remove dotnet-sdk
Manually download Dotnet SDK https://dotnet.microsoft.com/en-us/download/dotnet/6.0

When your download completes, open the terminal and run the following commands to extract the SDK to make the commands available at the terminal.

mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-6.0.101-linux-x64.tar.gz -C $HOME/dotnet
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet

one last thing Edit shell profile to permanently

Related