3

I have WSL 18.04 (Ubuntu) and I want to use NuGet.exe to install a Nuget Package to a folder (not .csproj) using the code below:

nuget install Test.Nuget.Version -OutputDirectory packages

In WSL, I use sudo apt install nuget. However that will only install an old nuget version 2.8.xxx in Ubuntu. =(

In order to run nuget install command, I must use the latest version of NuGet version (5.x.x) installed in Ubuntu.

Is it possible to install latest NuGet version in Ubuntu? If yes, how can I do so?

TooTone
  • 6,921
  • 4
  • 32
  • 59
Unknown
  • 327
  • 2
  • 9

1 Answers1

2

Normally you can get nuget to update itself:

nuget.exe update -self

However recently, because I assume they have updated the min TLS version, one can get the following error:

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

So your nuget version has to be new enough to upgrade itself.

So you have to get a new nuget.exe by alternative means:

curl https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -o nuget.exe
Tom
  • 5,877
  • 4
  • 27
  • 45