Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install NuGet from command line on linux

Tags:

linux

nuget

I need to install NuGet on Linux based machine.When am using the following command in Windows machine it works fine.

nuget install packages.config

But I am unable to do this with linux machine, how to achieve this?

like image 304
user3610920 Avatar asked Jun 30 '16 09:06

user3610920


People also ask

Can NuGet run in Linux?

The nuget.exe CLI, nuget.exe , is the command-line utility for Windows that provides all NuGet capabilities; it can also be run on Mac OSX and Linux using Mono with some limitations.

How do I Download NuGet command line?

You can download the latest version from nuget.org/downloads. The latest version is always recommended, and 4.1. 0+ is required to publish packages to nuget.org. The file is not an installer, and it is the nuget.exe file directly.

How do I run a NuGet command?

To use any command, open a command window or bash shell, then run nuget followed by the command and appropriate options, such as nuget help pack (to view help on the pack command). This documentation reflects the latest version of the NuGet CLI.


1 Answers

Once you've followed the (somewhat annoying) install steps to get .Net core installed and the apt repo setup from https://www.microsoft.com/net/core, you can just do this:

sudo apt install nuget 

and you'll have a working nuget on your local machine:

$ cat /etc/issue Ubuntu 16.04.1 LTS \n \l  $ nuget NuGet Version: 2.8.7.0 usage: NuGet <command> [args] [options]  Type 'NuGet help <command>' for help on a specific command. 

Notice that as of the time of writing do not run nuget update -self, as although it will successfully install a more recent version of nuget, that version won't actually run.

If you do break it though, you can always just blow it away and reinstall:

sudo apt remove nuget sudo apt install nuget 
like image 183
Doug Avatar answered Sep 28 '22 00:09

Doug