# 使用 Homebrew, apk, chocolatey, dnf, MacPorts, Nix, pacman, zypper, scoop, winget 安装 k9s

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

## 安装

```sh
sudo av install brew:k9s
```

## 代理安全回答

k9s is an interactive Kubernetes UI with cluster read and mutation capability.

- **凭据访问:** Reads kubeconfig, cluster tokens, and pod/secret views allowed by the current context.
- **远程变更:** Can delete, edit, scale, and exec into Kubernetes resources.
- **发布/制品风险:** Can change live workloads and configuration.
- **推荐控制:** Gate launch in privileged contexts and commands that mutate resources.
- **代理使用指南:** Use read-only contexts for agents; require approval before interactive cluster mutation.

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install k9s
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install k9s
```

  证据: MacPorts ports tree: sysutils/k9s/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add k9s
```

  证据: Alpine Linux edge package indexes: k9s from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- dnf (92%):

```sh
sudo dnf install k9s
```

  证据: Fedora Rawhide package metadata: k9s 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#k9s
```

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

- pacman (92%):

```sh
sudo pacman -S k9s
```

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

- zypper (92%):

```sh
sudo zypper install k9s
```

  证据: openSUSE Tumbleweed package metadata: k9s from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- Chocolatey (92%):

```sh
choco install k9s
```

  证据: Chocolatey community package catalog: k9s from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','java7u13x86'

- Scoop (92%):

```sh
scoop install main/k9s
```

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

- winget (92%):

```sh
winget install --id Derailed.k9s -e
```

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

## 软件包事实

- **软件包键:** brew:k9s
- **软件包管理器:** Homebrew
- **版本:** 0.51.0
- **来源摘要:** Kubernetes CLI To Manage Your Clusters In Style!
- **主页:** <https://k9scli.io/>
- **仓库:** <https://github.com/derailed/k9s>
- **最后更新:** 2026-07-27T21:58:35+02:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- k9s (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

K9s is a terminal user interface for Kubernetes that turns cluster navigation, inspection, and common operations into a keyboard-driven local app. It became one of the recognizable post-kubectl tools for operators who wanted a faster view of resources without moving into a full graphical dashboard.

### 项目历史

The derailed/k9s repository was created in January 2019. The project describes K9s as a Kubernetes CLI for managing clusters in style and says it provides a terminal UI that continually watches Kubernetes resources for changes.

K9s evolved around the idea that many Kubernetes workflows are repetitive inspection loops: list pods, jump to logs, describe resources, edit manifests, switch namespaces, and watch status. Its documentation grew into topics for installation, configuration, skins, plugins, benchmarks, and operational commands.

### 采用历史

K9s spread through the normal cross-platform CLI packaging routes. Its official install documentation lists Homebrew and MacPorts on macOS, Linuxbrew and Pacman on Linux, and Scoop or Chocolatey on Windows, which made it easy to add to existing Kubernetes workstations.

The project reached a scale visible in repository metadata: tens of thousands of GitHub stars and thousands of forks by July 2026. That level of attention is unusual for a single-purpose terminal UI and reflects the centrality of Kubernetes day-to-day operations.

### 使用方式

K9s is used as an interactive cluster console. Operators open it against a kubeconfig context, watch resource tables update, drill into pods and workloads, tail logs, and trigger common commands without repeatedly composing kubectl invocations.

It complements rather than replaces kubectl: kubectl remains the scriptable primitive, while K9s is the fast human interface for scanning, debugging, and moving around clusters.

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

K9s is package-nerd catnip because it packages a large Kubernetes workflow into one local binary with a memorable name, broad package-manager coverage, and obvious daily utility. It is also a marker of the TUI renaissance in infrastructure tooling, alongside projects that use terminal layouts as serious operational interfaces.

Its configuration paths differ across Linux, macOS, and Windows, which makes it a useful example for package databases that track real application state rather than only executable names.

### 时间线

- 2019-01: Public GitHub repository created.
- 2021: The release stream had reached the v0.24 and v0.25 series.
- 2026-07-01: Repository metadata showed more than 34,000 stars and more than 2,200 forks.

### Related projects

- K9s sits beside kubectl, kubectx, kubens, Stern, Lens, OpenLens, Helm, and K8sGPT in the Kubernetes operator toolbox. Its closest conceptual relatives are terminal dashboards and resource browsers rather than deployment or package managers.

### 来源

- <https://api.github.com/repos/derailed/k9s>
- <https://github.com/derailed/k9s>
- <https://github.com/derailed/k9s/releases>
- <https://k9scli.io/>
- <https://k9scli.io/topics>
- <https://k9scli.io/topics/install/>


## 安全说明

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

- Linux: $XDG_CONFIG_HOME/k9s/config.yaml, ~/.config/k9s/config.yaml
- macOS: ~/Library/Application Support/k9s/config.yaml
- Windows: %LOCALAPPDATA%\k9s\config.yaml
## 其他软件包管理器记录

- Nix - k9s: normalized package name match | nixpkgs package indexes: pkgs/by-name/k9/k9s/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - k9s - 0.51.0-r1: normalized package name match | Alpine Linux edge package indexes: k9s from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Kubernetes TUI | https://k9scli.io
- apk - k9s-bash-completion - 0.51.0-r1: normalized package name match | Alpine Linux edge package indexes: k9s-bash-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Bash completions for k9s | https://k9scli.io
- apk - k9s-fish-completion - 0.51.0-r1: normalized package name match | Alpine Linux edge package indexes: k9s-fish-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Fish completions for k9s | https://k9scli.io
- apk - k9s-zsh-completion - 0.51.0-r1: normalized package name match | Alpine Linux edge package indexes: k9s-zsh-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Zsh completions for k9s | https://k9scli.io
- dnf - k9s - 0.51.0-3.fc45: normalized package name match | Fedora Rawhide package metadata: k9s from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Kubernetes CLI To Manage Your Clusters In Style | https://github.com/derailed/k9s
- pacman - k9s - 0.51.0-1: normalized package name match | Arch Linux sync databases: k9s from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | TUI for managing Kubernetes clusters and pods | https://github.com/derailed/k9s
- zypper - k9s - 0.51.0-1.4: normalized package name match | openSUSE Tumbleweed package metadata: k9s from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Curses based terminal UI for Kubernetes clusters | https://github.com/derailed/k9s
- MacPorts - k9s: normalized package name match | MacPorts ports tree: sysutils/k9s/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Chocolatey - k9s: normalized package name match | Chocolatey community package catalog: k9s from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','java7u13x86'
- Scoop - main/k9s: normalized package name match | Scoop official bucket manifest trees: bucket/k9s.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - Derailed.k9s: normalized package name match | Windows Package Manager source index: Derailed.k9s from https://cdn.winget.microsoft.com/cache/source.msix


## Combined YAML source

View the package source record on GitHub. [combined/k9s.yml](https://github.com/mxcl/pkgdb/blob/main/combined/k9s.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
