簡體   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