繁体   English   中英

如何在 Ubuntu 18.04 WSL 中安装最新版本的 NuGet.exe CLI?

[英]How to install the latest version of NuGet.exe CLI in Ubuntu 18.04 WSL?

我有 WSL 18.04 (Ubuntu),我想使用 NuGet.exe 使用以下代码将 Nuget 包安装到文件夹(不是 .csproj):

nuget install Test.Nuget.Version -OutputDirectory packages

在 WSL 中,我使用sudo apt install nuget 但是,这只会在 Ubuntu 中安装旧的 nuget 版本 2.8.xxx。 =(

为了运行nuget install命令,我必须使用安装在 Ubuntu 中的最新版 NuGet 版本 (5.xx)。

是否可以在 Ubuntu 中安装最新的 NuGet 版本? 如果是,我该怎么做?

通常你可以让 nuget 自我更新:

nuget.exe update -self

但是最近,因为我假设他们已经更新了最小 TLS 版本,所以可能会出现以下错误:

The authentication or decryption has failed.
  Error while sending TLS Alert (Fatal:InternalError): System.IO.IOException:

因此,您的 nuget 版本必须足够新才能自行升级。

因此,您必须通过其他方式获取新的 nuget.exe:

curl https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -o nuget.exe

暂无
暂无

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

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