如何在 Linux 上从命令行安装 NuGet [英] How to install NuGet from command line on linux
问题描述
我需要在基于 Linux 的机器上安装 NuGet.当我在 Windows 机器上使用以下命令时,它工作正常.
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
但是我在linux机器上无法做到这一点,如何实现呢?
But I am unable to do this with linux machine, how to achieve this?
推荐答案
一旦你按照(有点烦人的)安装步骤从 https://www.microsoft.com/net/core,你可以这样做:
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
你的本地机器上会有一个工作的 nuget:
and you'll have a working nuget on your local machine:
$ cat /etc/issue
Ubuntu 16.04.1 LTS
l
$ nuget
NuGet Version: 2.8.7.0
usage: NuGet <command> [args] [options]
Type 'NuGet help <command>' for help on a specific command.
请注意,在撰写本文时不运行 nuget update -self
,因为虽然它会成功安装更新版本的 nuget,但该版本不会't 实际运行.
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
这篇关于如何在 Linux 上从命令行安装 NuGet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!