如何在不使用 sudo 的情况下在 Ubuntu 上安装 .Net Core?
How do you install .Net Core on Ubuntu without using sudo?
Ubuntu 14 的当前安装说明要求使用 sudo (https://www.microsoft.com/net/core#ubuntu). I don't have root permissions on a particular Ubuntu 12 server that I need to install .Net Core on. I have tried to download the Ubuntu files (https://www.microsoft.com/net/download#core) 并手动安装它们,但是当我 运行 'dotnet restore' 时出现以下错误:
Failed to initialize CoreCLR, HRESULT: 0x8007001F
据此:
https://github.com/dotnet/cli/issues/2971
这是一个权限问题和修复:
As soon as I do chmod +X to my binary (here it's tata) it works.
来自 tar.gz 的 运行 dotnet
在 Ubuntu 14.
上对我来说效果很好
运行 来自 tar.gz 或从源代码构建在 Ubuntu 12 上对我不起作用。但是 Ubuntu 12 不受 dotnet
支持, 所以它不起作用我并不感到惊讶。
不使用 sudo
不是问题,使用旧的 OS 才是问题。
根据 https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x 你可以使用 "The dotnet-install scripts are used to perform a non-admin install of the CLI toolchain"。尽管如前所述,结果可能会因 linux os 和版本而异。如果有问题,我可能会推荐 运行 一个虚拟机来测试与不同版本的兼容性。文件权限也很重要。
Ubuntu 14 的当前安装说明要求使用 sudo (https://www.microsoft.com/net/core#ubuntu). I don't have root permissions on a particular Ubuntu 12 server that I need to install .Net Core on. I have tried to download the Ubuntu files (https://www.microsoft.com/net/download#core) 并手动安装它们,但是当我 运行 'dotnet restore' 时出现以下错误:
Failed to initialize CoreCLR, HRESULT: 0x8007001F
据此:
https://github.com/dotnet/cli/issues/2971
这是一个权限问题和修复:
As soon as I do chmod +X to my binary (here it's tata) it works.
运行 dotnet
在 Ubuntu 14.
运行 来自 tar.gz 或从源代码构建在 Ubuntu 12 上对我不起作用。但是 Ubuntu 12 不受 dotnet
支持, 所以它不起作用我并不感到惊讶。
不使用 sudo
不是问题,使用旧的 OS 才是问题。
根据 https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x 你可以使用 "The dotnet-install scripts are used to perform a non-admin install of the CLI toolchain"。尽管如前所述,结果可能会因 linux os 和版本而异。如果有问题,我可能会推荐 运行 一个虚拟机来测试与不同版本的兼容性。文件权限也很重要。