# Install mksh with Homebrew, apk, apt, dnf, MacPorts, Nix, zypper

MirBSD Korn Shell. Version 59c via Homebrew; verified from local package data. Also installable with debian: sudo apt install mksh.

## Install

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

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install mksh
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install mksh
```

  Evidence: 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
```

  Evidence: 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
```

  Evidence: 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
```

  Evidence: 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
```

  Evidence: 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
```

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

## Package facts

- **Package key:** brew:mksh
- **Package manager:** Homebrew
- **Version:** 59c
- **Source summary:** MirBSD Korn Shell
- **Homepage:** <https://mbsd.evolvis.org/mksh.htm>
- **Generated:** 2026-08-03T19:37:03+00:00

## Executables

- mksh (alias)

## Install behavior

- Bottle: not available

## Freshness

- Page generated: 2026-08-03
- Package-manager version: 59c
## Project history and usage

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.

### Project history

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.

### Adoption history

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.

### How it is used

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.

### Why package nerds care

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.

### Timeline

- 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.

### Sources

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


## Security Notes

generalized runtime or code generation signal.

- **Geiger risk:** yellow / medium
- 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
## Other Package-Manager Records

- 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)


## Sources

- 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
