# mksh を Homebrew, apk, apt, dnf, MacPorts, Nix, zypper でインストール

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
