简体   繁体   English

如何在不使用sudo的情况下在Ubuntu上安装.Net Core?

[英]How do you install .Net Core on Ubuntu without using sudo?

The current installation instructions for Ubuntu 14 require the use of sudo ( https://www.microsoft.com/net/core#ubuntu ). 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. 我没有在我需要安装.Net Core的特定Ubuntu 12服务器上拥有root权限。 I have tried to download the Ubuntu files ( https://www.microsoft.com/net/download#core ) and install them manually but I get the following error when I run 'dotnet restore': 我试图下载Ubuntu文件( https://www.microsoft.com/net/download#core )并手动安装它们但是当我运行'dotnet restore'时出现以下错误:

Failed to initialize CoreCLR, HRESULT: 0x8007001F

Running dotnet from the tar.gz works just fine for me on Ubuntu 14. 从tar.gz运行dotnet对我来说在Ubuntu 14上运行得很好。

Running from the tar.gz or building from source does not work for me on Ubuntu 12. But Ubuntu 12 is not supported by dotnet , so I'm not surprised it does not work. 从tar.gz运行或从源代码构建在Ubuntu 12上对我不起作用。但是dotnet不支持Ubuntu 12,所以我并不感到惊讶它不起作用。

Not using sudo is not an issue, having old OS is. 不使用sudo不是问题,有旧操作系统。

According to this: 根据这个:

https://github.com/dotnet/cli/issues/2971 https://github.com/dotnet/cli/issues/2971

it's a permissions issue and the fix: 这是一个权限问题和修复:

As soon as I do chmod +X to my binary (here it's tata) it works. 一旦我对我的二进制文件chmod + X(这里是tata),它就可以工作了。

According to https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x you can use "The dotnet-install scripts are used to perform a non-admin install of the CLI toolchain". 根据https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x,您可以使用“dotnet-install脚本用于执行CLI工具链的非管理员安装” 。 Although as mentioned results may vary depending on the linux os and version. 虽然提到结果可能会有所不同,具体取决于Linux操作系统和版本。 I might recommend running a vm to test compatibilities with different versions if having issues. 如果遇到问题,我可能会建议运行vm来测试不同版本的兼容性。 File permissions are also important. 文件权限也很重要。

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

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