繁体   English   中英

使用 do.net-install 脚本在 Ubuntu 上安装 .Net sdk 时权限被拒绝

[英]Permission denied while installing .Net sdk on Ubuntu with dotnet-install scripts

我在usr/share/do.net下安装了一些 .Net sdks,我正在尝试在同一位置使用do.net-install.sh安装新版本,如下所示:

dotnet-install.sh --install-dir /usr/share/dotnet --no-path

即使我已经chmod +x脚本,安装仍然会记录权限被拒绝的问题。

dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.

dotnet-install: Attempting to download using primary link https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.101/dotnet-sdk-6.0.101-linux-x64.tar.gz
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.101/dotnet-sdk-6.0.101-linux-x64.tar.gz
cp: cannot create directory '/usr/share/dotnet/host/fxr/6.0.1/': Permission denied
cp: cannot create directory '/usr/share/dotnet/packs/Microsoft.AspNetCore.App.Ref/6.0.0/': Permission denied
cp: cannot create directory '/usr/share/dotnet/packs/Microsoft.NETCore.App.Host.linux-x64/6.0.1/': Permission denied
cp: cannot create directory '/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.1/': Permission denied
cp: cannot create directory '/usr/share/dotnet/sdk/6.0.101/': Permission denied
mkdir: cannot create directory ‘/usr/share/dotnet/sdk/6.0.101’: Permission denied
cp: cannot create directory '/usr/share/dotnet/sdk/6.0.101/DotnetTools/dotnet-dev-certs/6.0.1-servicing.21567.14/': No such file or directory
mkdir: cannot create directory ‘/usr/share/dotnet/sdk/6.0.101’: Permission denied
cp: cannot create directory '/usr/share/dotnet/sdk/6.0.101/DotnetTools/dotnet-user-secrets/6.0.1-servicing.21567.14/': No such file or directory
mkdir: cannot create directory ‘/usr/share/dotnet/sdk/6.0.101’: Permission denied
cp: cannot create directory '/usr/share/dotnet/sdk/6.0.101/DotnetTools/dotnet-watch/6.0.101-servicing.21569.16/': No such file or directory
mkdir: cannot create directory ‘/usr/share/dotnet/sdk-manifests’: Permission denied
cp: cannot create directory '/usr/share/dotnet/sdk-manifests/6.0.100/': No such file or directory
cp: cannot create directory '/usr/share/dotnet/shared/Microsoft.AspNetCore.App/6.0.1/': Permission denied
cp: cannot create directory '/usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.1/': Permission denied
cp: cannot create directory '/usr/share/dotnet/templates/6.0.1/': Permission denied
cp: cannot create regular file '/usr/share/dotnet/LICENSE.txt': Permission denied
cp: cannot create regular file '/usr/share/dotnet/ThirdPartyNotices.txt': Permission denied
cp: cannot create regular file '/usr/share/dotnet/dotnet': Permission denied
dotnet_install: Error: Failed to verify the version of installed `.NET Core SDK

我在这里错过了什么?

我建议使用 sudo 运行 do.net-install.sh 脚本。
或者将 do.net-install.sh 标记为可执行文件: sudo chmod +x./do.net-install.sh

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM