> For the complete documentation index, see [llms.txt](https://asus-isg-aidc.gitbook.io/guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://asus-isg-aidc.gitbook.io/guide/latest/cli/commandreference/package.md).

# Package Management

| Developer | Last modified |
| --------- | ------------- |
| AIDC Team | 2026/07/06    |

## Table of Contents

* [1. Overview](#overview)
* [2. Subcommands](#subcommands)
* [3. Usage Examples](#usage-examples)

***

## 1. Overview <a href="#overview" id="overview"></a>

{% hint style="warning" %}
**⚠️ Prerequisite: `aidc-cli init` required first**

This command depends on settings saved by [`aidc-cli init`](/guide/latest/cli/commandreference/init.md). Before running it, make sure you have completed:

* [`aidc-cli init inventory`](/guide/latest/cli/commandreference/init.md#inventory) — render the node inventory from `aidc.csv`
* SSH access to the nodes — [`aidc-cli deploy install`](/guide/latest/cli/commandreference/deploy.md) sets this up during OS deployment; for nodes that already have an OS, run [`aidc-cli deploy access-key`](/guide/latest/cli/commandreference/deploy.md) or fill the `password` column in `aidc.csv`
* [`aidc-cli init pkg-set`](/guide/latest/cli/commandreference/init.md#package-configuration) — save the package source settings

For the full setup sequence, see the [Getting Started](/guide/latest/cli/gettingstarted.md) guide.
{% endhint %}

The `pkg` command manages software package installation and removal on target nodes, including custom packages via system package managers and NVLink switch OS deployment.

```bash
aidc-cli pkg <subcommand> [flags]
```

***

## 2. Subcommands <a href="#subcommands" id="subcommands"></a>

### 2.1 `extra-pkg` — Install/Remove Extra Packages

Installs or removes packages using the specified system package manager.

```bash
aidc-cli pkg extra-pkg --pkg_mgr <manager> --pkg_list <packages> [--install | --remove]
```

| Flag         | Short | Required | Description                                |
| ------------ | :---: | :------: | ------------------------------------------ |
| `--pkg_mgr`  |  `-m` |     ✅    | Package manager: `yum`, `dnf`, `apt`, etc. |
| `--pkg_list` |  `-p` |    ❌\*   | Comma-separated list of package names      |
| `--install`  |   —   |    ❌\*   | Install packages                           |
| `--remove`   |   —   |    ❌\*   | Remove packages                            |

{% hint style="warning" %}
`--install` and `--remove` are mutually exclusive. Either one must be specified. `--pkg_list` is required whenever `--install` or `--remove` is used.
{% endhint %}

***

### 2.2 `nvlink-sw` — NVLink Switch OS

Deploys the NVLink switch operating system.

```bash
aidc-cli pkg nvlink-sw -f <file>
```

| Flag     | Short | Required | Description                |
| -------- | :---: | :------: | -------------------------- |
| `--file` |  `-f` |     ✅    | NVLink switch OS file path |

***

## 3. Usage Examples <a href="#usage-examples" id="usage-examples"></a>

```bash
# Install specific packages via yum
aidc-cli pkg extra-pkg -m yum --install -p nmap,unzip

# Remove specific packages
aidc-cli pkg extra-pkg -m yum --remove -p nmap,unzip

# Install packages on specific nodes
aidc-cli pkg extra-pkg -m dnf -p iperf3 --install -l node01,node02

# Deploy NVLink switch OS
aidc-cli pkg nvlink-sw -f "nvlink-switch-os-v2.0.bin"
```
