# 使用 Homebrew, dnf, Nix, pacman, scoop, winget 安装 nuget

查看 nuget 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:nuget
```

## 代理安全回答

nuget manages .NET packages and registry publishing.

- **凭据访问:** Reads NuGet API keys, package source credentials, and config files.
- **远程变更:** Can push packages and change package-source state.
- **发布/制品风险:** Can publish .NET packages and symbols.
- **推荐控制:** Gate push, delete, source credential, and API-key commands.
- **代理使用指南:** Allow restore/list; require approval for package publication and credential changes.

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install nuget
```

  证据: local Homebrew formula metadata

### Linux

- dnf (92%):

```sh
sudo dnf install nuget
```

  证据: Fedora Rawhide package metadata: nuget from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#nuget
```

  证据: nixpkgs package indexes: pkgs/by-name/nu/nuget/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S nuget
```

  证据: Arch Linux sync databases: nuget from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

### Windows

- Scoop (92%):

```sh
scoop install main/nuget
```

  证据: Scoop official bucket manifest trees: bucket/nuget.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id Microsoft.NuGet -e
```

  证据: Windows Package Manager source index: Microsoft.NuGet from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:nuget
- **软件包管理器:** Homebrew
- **版本:** 7.6.0
- **来源摘要:** Package manager for Microsoft development platform including .NET
- **主页:** <https://www.nuget.org/>
- **最后更新:** 2026-05-14T02:59:39Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- nuget (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 7.6.0
## 项目历史与用法

NuGet is the canonical package manager for the Microsoft .NET ecosystem: a client toolchain, package format, public gallery, and set of repository conventions for creating, publishing, restoring, and consuming .NET libraries.

### 项目历史

The project began in 2010 as NuPack in the ASP.NET / Microsoft web tooling orbit. Phil Haack's October 6, 2010 announcement described it as an open source, developer-focused package manager for simplifying third-party library use in .NET applications, and said the Outercurve Foundation had accepted the project into the ASP.NET Open Source Gallery.

The NuPack name was quickly changed. Haack's October 21, 2010 post opened public voting on replacement names, and his October 29, 2010 follow-up announced NuGet as the winner. That rename is part of NuGet lore because it tied the package manager's identity to community input before the project settled into the .NET platform.

### 采用历史

NuGet solved a very visible .NET pain point: finding libraries, adding assembly references, putting files in predictable project locations, applying config transforms, and updating dependencies. A November 2011 MSDN Magazine article presented NuGet as the rescue path from manual library download and reference management, and noted that ASP.NET MVC 3 already included it.

NuGet's adoption is structural rather than just CLI popularity. Microsoft Learn describes NuGet packages as .nupkg zip files carrying compiled code, related files, and manifest metadata; package authors publish them to public or private hosts, while consumers add them to projects and call the package functionality from application code. NuGet.org is the central public repository for that workflow.

Homebrew packages the standalone `nuget` command for macOS/Linux users outside Visual Studio. The Homebrew formula showed stable version 7.6.0 and 26,865 installs over the 365-day analytics window visible on July 1, 2026.

### 使用方式

Package nerds use NuGet in three overlapping ways: `nuget.exe` for pack/push/restore workflows, Visual Studio's package manager UI and console for project work, and modern SDK/MSBuild restore paths for repeatable CI. The important artifact is the `.nupkg`, whose ID, semantic version, dependencies, target framework assets, metadata, and source repository fields become part of the .NET dependency graph.

Practical usage is not only installing public packages. Organizations run private NuGet feeds for internal libraries, mirror/cache packages for build reproducibility, pin or float versions through project files and lock files, and publish prerelease packages from CI before promoting stable versions to nuget.org or an internal feed.

### 为什么软件包爱好者会关心

NuGet is infrastructure for the .NET supply chain. It defines the default package unit, public distribution hub, and restore semantics for a large share of .NET application builds, which makes it comparable in ecosystem role to npm for JavaScript or PyPI/pip for Python.

### 时间线

- 2010-10-06: NuPack/NuGet announced as an open source .NET package manager accepted by the Outercurve Foundation into the ASP.NET Open Source Gallery.
- 2010-10-21: NuPack rename vote opened.
- 2010-10-29: NuGet announced as the selected name.
- 2011-11: MSDN Magazine documented NuGet's package-install, update, and PowerShell-console workflows for Visual Studio users.

### Related projects

- NuGet Gallery
- NuGet.Client
- NuGet/Home
- .NET SDK restore
- MSBuild

### 来源

- <https://formulae.brew.sh/formula/nuget>
- <https://haacked.com/archive/2010/10/06/introducing-nupack-package-manager.aspx/>
- <https://haacked.com/archive/2010/10/21/renaming-nupack.aspx/>
- <https://haacked.com/archive/2010/10/29/nupack-is-now-nuget.aspx/>
- <https://learn.microsoft.com/en-us/archive/msdn-magazine/2011/november/nuget-manage-project-libraries-with-nuget>
- <https://learn.microsoft.com/en-us/nuget/what-is-nuget>
- <https://www.nuget.org/>


## 安全说明

infrastructure mutation or orchestration signal.

- **Geiger 风险:** orange / 中
- infrastructure mutation or orchestration signal


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ~/.nuget/NuGet/NuGet.Config, ~/.config/NuGet/NuGet.Config

## Credential files

- Unix: ~/.nuget/NuGet/NuGet.Config, ~/.config/NuGet/NuGet.Config
## 其他软件包管理器记录

- Nix - nuget: normalized package name match | nixpkgs package indexes: pkgs/by-name/nu/nuget/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- dnf - nuget - 2.8.7-25.fc45: normalized package name match | Fedora Rawhide package metadata: nuget from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Package manager for .Net/Mono development platform | http://nuget.org/
- dnf - nuget-devel - 2.8.7-25.fc45: normalized package name match | Fedora Rawhide package metadata: nuget-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Development files for nuget | http://nuget.org/
- pacman - nuget - 6.11.1-1: normalized package name match | Arch Linux sync databases: nuget from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Package manager for .NET. | https://www.nuget.org
- Scoop - main/nuget: normalized package name match | Scoop official bucket manifest trees: bucket/nuget.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - Microsoft.NuGet: normalized package name match | Windows Package Manager source index: Microsoft.NuGet from https://cdn.winget.microsoft.com/cache/source.msix


## Combined YAML source

View the package source record on GitHub. [combined/nuget.yml](https://github.com/mxcl/pkgdb/blob/main/combined/nuget.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
- curated agent safety answer
