# 使用 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/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-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/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## 软件包事实

- **软件包键:** brew:mksh
- **软件包管理器:** Homebrew
- **版本:** 59c
- **来源摘要:** MirBSD Korn Shell
- **主页:** <https://mbsd.evolvis.org/mksh.htm>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- mksh (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

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
## 其他软件包管理器记录

- 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-16.fc45: normalized package name match | Fedora Rawhide package metadata: mksh from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | MirBSD enhanced version of the Korn Shell | https://www.mirbsd.org/mksh.htm
- zypper - mksh - 59c-7.3: normalized package name match | openSUSE Tumbleweed package metadata: mksh from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-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


## Combined YAML source

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