# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, zypper 安装 mksh

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

## 安装

```sh
sudo av install brew:mksh
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install mksh
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install mksh
```

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

### Linux

- apk (92%):

```sh
sudo apk add mksh
```

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

- Debian apt (92%):

```sh
sudo apt install mksh
```

  证据: Debian stable package indexes: mksh from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install mksh
```

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

- Nix (92%):

```sh
nix profile install nixpkgs#mksh
```

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

- zypper (92%):

```sh
sudo zypper install mksh
```

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

## 软件包事实

- **软件包键:** brew:mksh
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/mksh>
- **版本:** 59c
- **来源摘要:** MirBSD Korn Shell
- **主页:** <https://mbsd.evolvis.org/mksh.htm>
- **仓库:** <https://www.mirbsd.org/cvs.cgi/src/bin/mksh>
- **上游文档:** <https://mbsd.evolvis.org/mksh.htm>
- **许可证:** MirOS
- **源码归档:** <https://mbsd.evolvis.org/MirOS/dist/mir/mksh/mksh-R59c.tgz>
- **已生成:** 2026-07-08T07:18:31+00:00

## 可执行文件

- mksh (cli)
- mksh (别名)

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_big_sur, arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, big_sur, catalina, monterey, sonoma, ventura

## 版本和新鲜度

- 页面生成时间: 2026-07-08
- 管理器版本: 59c
- 本地数据: OK
- 上游仓库: https://mbsd.evolvis.org/mksh.htm
- 信息: No package-manager update timestamp was available.
- 信息: Release/tag comparison is only available for GitHub repositories.
## 项目历史与用法

mksh, the MirBSD Korn Shell, is a Bourne/POSIX/Korn-style command interpreter and scripting language. The official site describes it as an actively developed free implementation of the Korn Shell programming language and successor to the Public Domain Korn Shell line.

### 项目历史

The mksh FAQ traces the lineage from the Public Domain Bourne Shell and pdksh, through OpenBSD cleanup work, to MirBSD development beginning in 2002. After 2004, development added portability, parser reorganization, bug fixes, and features influenced by ksh93, bash, zsh, BSD csh, and POSIX work.

The official mksh page lists R59c from October 31, 2020 as the current version and provides signed source distributions plus instructions for CVS HEAD.

### 采用历史

mksh became the system shell in several operating systems and Linux distributions. The FAQ says it is used as Android's system shell for startup, background, and user-invoked commands.

Its broad packaging footprint across Homebrew, Debian, Ubuntu, Alpine, Fedora, Nix, MacPorts, and SUSE reflects a mature portable shell rather than a platform-specific utility.

### 使用方式

The mksh manual describes it as a command interpreter for both interactive and shell-script use, with a command language that is a superset of sh and POSIX shell and largely compatible with the original Korn shell.

Interactive users normally use `~/.mkshrc` or `$ENV`; login shells also process profile files. Packagers commonly install `dot.mkshrc` into `/etc/skel/.mkshrc` or `/etc/mkshrc` with a user-editable wrapper.

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

mksh matters to package nerds because shells sit at the boundary between user environment, system boot scripts, and package maintainer scripts. It is a small but consequential runtime whose packaging choices affect `/bin/sh` compatibility, skeleton rc files, Android system behavior, and historical Korn shell compatibility.

It is also a case where the official project explicitly labels its GitHub mirror unofficial, so package metadata should prefer the MirBSD homepage, signed distfiles, manual, FAQ, and CVS/CVSweb sources.

### 时间线

- 1980s: Public Domain Bourne Shell lineage begins, later becoming pdksh.
- 1999: pdksh development ends.
- 2002: Development of what became mksh starts as MirBSD's system shell.
- 2003: OpenBSD cleanup of pdksh feeds into the lineage.
- 2004: mksh sees independent parser, portability, and feature work.
- 2020-10: Official page lists mksh R59c as current.

### Related projects

- mksh is related to pdksh, oksh, AT&T ksh/ksh93, POSIX sh, bash, zsh, lksh, Android system shell usage, MirBSD, Debian, and OpenWrt/FreeWRT packaging.

### 来源

- <https://mbsd.evolvis.org/mksh.htm>
- <https://www.mirbsd.org/man1/mksh>
- <https://www.mirbsd.org/mksh-faq.htm>


## 安全说明

generalized runtime or code generation signal.

- **Geiger 风险:** yellow / 中
- generalized runtime or code generation 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: /etc/skel/.mkshrc, /etc/mkshrc
- Unix: ~/.mkshrc, ~/.profile, /etc/profile, /etc/suid_profile, /etc/shells
## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** mksh
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## 其他软件包管理器记录

- Debian apt - mksh - 59c-41+b2: normalized package name match | Debian stable package indexes: mksh from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | MirBSD Korn Shell | http://mirbsd.de/mksh
- Nix - mksh: normalized package name match | nixpkgs package indexes: pkgs/by-name/mk/mksh/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - mksh - 59c-37: normalized package name match | Ubuntu 24.04 LTS package indexes: mksh from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | MirBSD Korn Shell | http://mirbsd.de/mksh
- apk - mksh - 59c-r4: normalized package name match | Alpine Linux edge package indexes: mksh from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | MirBSD Korn Shell | https://www.mirbsd.org/mksh
- apk - mksh-doc - 59c-r4: normalized package name match | Alpine Linux edge package indexes: mksh-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | MirBSD Korn Shell (documentation) | https://www.mirbsd.org/mksh
- dnf - mksh - 59c-15.fc44: normalized package name match | Fedora Rawhide package metadata: mksh from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | MirBSD enhanced version of the Korn Shell | https://www.mirbsd.org/mksh.htm
- zypper - mksh - 59c-7.1: normalized package name match | openSUSE Tumbleweed package metadata: mksh from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | MirBSD Korn Shell | https://mbsd.evolvis.org/mksh.htm
- MacPorts - mksh: normalized package name match | MacPorts ports tree: shells/mksh/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## 相关链接

- [Secret-risk packages](https://www.automicvault.com/zh-hans/pkg/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://www.automicvault.com/zh-hans/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Language runtime packages](https://www.automicvault.com/zh-hans/pkg/language-runtime-packages/) - Matched language runtime, compiler, or interpreter metadata.
- [Networking and protocol packages](https://www.automicvault.com/zh-hans/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [ksh93](https://www.automicvault.com/zh-hans/pkg/brew/ksh93/) - Shares av.db curated category or tags: cli, language-runtime, scripting, shell, unix.
- [ammonite-repl](https://www.automicvault.com/zh-hans/pkg/brew/ammonite-repl/) - Shares av.db curated category or tags: cli, language-runtime, scripting.
- [cpi](https://www.automicvault.com/zh-hans/pkg/brew/cpi/) - Shares av.db curated category or tags: cli, language-runtime, scripting.
- [gauche](https://www.automicvault.com/zh-hans/pkg/brew/gauche/) - Shares av.db curated category or tags: cli, language-runtime, scripting.
- [gnu-apl](https://www.automicvault.com/zh-hans/pkg/brew/gnu-apl/) - Shares av.db curated category or tags: cli, language-runtime, scripting.
- [gnu-smalltalk](https://www.automicvault.com/zh-hans/pkg/brew/gnu-smalltalk/) - Shares av.db curated category or tags: cli, language-runtime, scripting.
- [goawk](https://www.automicvault.com/zh-hans/pkg/brew/goawk/) - Shares av.db curated category or tags: cli, language-runtime, posix.
- [gosu](https://www.automicvault.com/zh-hans/pkg/brew/gosu/) - Shares av.db curated category or tags: cli, language-runtime, scripting.
- [oils-for-unix](https://www.automicvault.com/zh-hans/pkg/brew/oils-for-unix/) - Local package facts share a topical domain. Shared terms: cli, language, language-runtime, runtime, shell.

## Combined YAML source

View the package source record on GitHub. [combined/mksh.yml](https://github.com/automic-vault/db/blob/main/combined/mksh.yml)


## 来源

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
