setup-dotnet: Permission denied in /usr/share/dotnet
Description: Runner does not have permission to install in the default directory
Task version: 3.0.0
Platform:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted
- Self-hosted
Repro steps:
Use action with selfhosted ubuntu runner with non-root user permissions
Expected behavior: Install dotnet
Actual behavior: Permission denied
I tried using the env DOTNET_INSTALL_DIR
but it doesn’t seem to work
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 7
- Comments: 22 (8 by maintainers)
It would probably be good update the docs to include instructions to set
On self hosted linux nodes.
Hi, yes, comparing v3 to main there was no difference for me, both worked, using the following:
@andrewgbell, you are right. The default directory was changed (it’s breaking change), details and motivation can be found here.
Hi, @wzchua, @andrewgbell, @austindrenski and @mathieu-benoit 👋 The new patch version was just released to fix the issue with
DOTNET_INSTALL_DIR
environment variable. If your user doesn’t have permissions to write SDK’s files into the default directory, you can useDOTNET_INSTALL_DIR
to specify any other directory that suits you:Please, give us your feedback in the comments. If you have any additional questions, feel free to ask.
Hi, @andrewgbell 👋 Thank you for the feedback, we are working on this issue.
Hi, I don’t have sudo permission. I would prefer an option to install in a non-root location
this solution pollutes your working directory so git commands or versioning tools that except clean working directory will fail!
@wzchua, I’m going to close this issue, as the new patch version of the actions was released and it fixes the problems that were stated in the issue and in the comments below. If you have any additional questions, feel free to ping me.
Hi, @wzchua, @andrewgbell, @austindrenski, @mathieu-benoit, @lanwin 👋 Sorry for the late answer, the logic of processing
DOTNET_INSTALL_DIR
was updated. Could you please, test the action in your workflows and leave your feedback, specify themain
branch instead ofv3
like that:Hi @IvanZosimov. Does this now have to be defined when the agent doesn’t have root? Just curious as this wasn’t the case previously, so has the default install directory changed?
We have the same issue, was fine on v2.