# Install elan-init with Homebrew, apt, Nix, scoop, winget, MacPorts

Lean Theorem Prover installer and version manager. Version 4.2.3 via Homebrew; verified 2026-06-13. Also installable with macports: sudo port install lean.

## Install

```sh
sudo av install brew:elan-init
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install elan-init
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install lean
```

  Evidence: MacPorts ports tree: math/lean/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Debian apt (92%):

```sh
sudo apt install elan
```

  Evidence: Debian stable package indexes: elan from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- Nix (92%):

```sh
nix profile install nixpkgs#elan
```

  Evidence: nixpkgs package indexes: pkgs/by-name/el/elan/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

### Windows

- Scoop (92%):

```sh
scoop install main/elan
```

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

- winget (92%):

```sh
winget install --id Lean.Elan -e
```

  Evidence: Windows Package Manager source index: Lean.Elan from https://cdn.winget.microsoft.com/cache/source.msix

## Package facts

- **Package key:** brew:elan-init
- **Package manager:** Homebrew
- **Version:** 4.2.3
- **Source summary:** Lean Theorem Prover installer and version manager
- **Homepage:** <https://github.com/leanprover/elan>
- **Repository:** <https://github.com/leanprover/elan>
- **Last updated:** 2026-06-13T01:24:10+02:00
- **Generated:** 2026-08-03T19:37:03+00:00

## Executables

- elan (alias)
- elan-init (alias)
- lake (alias)
- lean (alias)
- leanc (alias)
- leanchecker (alias)
- leanmake (alias)
- leanpkg (alias)

## Install behavior

- Bottle: not available

## Freshness

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

elan is the Lean theorem prover toolchain manager. It installs Lean toolchains and places proxy binaries such as `lean`, `lake`, and `elan` on PATH so a project can select the compiler version declared in its `lean-toolchain` file.

### Project history

The elan repository was created in April 2018 as Lean's answer to language-specific version managers. Its README explicitly describes the implementation as a fork of rustup, adapted from Rust's toolchain model to Lean's compiler, package manager, and release infrastructure.

The design followed Lean's project-local workflow: a repository can commit a `lean-toolchain` file, and elan will automatically select and download the required Lean version when `lean` or `lake` is invoked.

### Adoption history

elan became central to modern Lean usage because Lean projects often depend on precise compiler versions, especially around Lean 4 nightly and stable releases. The Lean reference manual documents elan as the standard way to manage installed toolchains, select defaults, and override versions per project.

Its package adoption is practical rather than flashy: package managers distribute `elan-init`, while the installed proxies expose Lean, Lake, and related tools under their usual command names.

### How it is used

Typical usage starts with the `elan-init` installer, which installs into `~/.elan` by default and can update shell startup files. After installation, `elan show`, `elan default`, and project-local `lean-toolchain` files control which Lean version is active.

For package maintainers, elan matters because a single package can provide a family of executables while deferring the actual Lean compiler download until a project requests a specific toolchain.

### Why package nerds care

elan is a clean example of the rustup pattern spreading to another language ecosystem: a tiny manager package, shim executables, per-project version files, and lazy toolchain installation. That makes it especially interesting in package-manager databases because the package name `elan-init` is only the installer face of a larger language runtime workflow.

### Timeline

- 2018: GitHub repository created for the Lean toolchain manager.
- 2023: README examples show Lean 4 nightly toolchains selected by `lean-toolchain`.
- 2025: v4.0.0 released for the Lean 4 era.
- 2026: v4.2.x releases continue active maintenance.

### Related projects

- elan is closely related to Lean, Lake, leanpkg, and rustup. Its model also resembles ghcup, pyenv, nvm, and other language version managers, but it is tightly integrated with Lean's official toolchain naming.

### Sources

- <https://github.com/leanprover/elan>
- <https://raw.githubusercontent.com/leanprover/elan/master/README.md>
- <https://lean-lang.org/doc/reference/latest/Build-Tools-and-Distribution/Managing-Toolchains-with-Elan>
- <https://api.github.com/repos/leanprover/elan>
- <https://api.github.com/repos/leanprover/elan/releases>


## Security Notes

infrastructure mutation or orchestration signal.

- **Geiger risk:** orange / medium
- 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

- Unix: lean-toolchain
## Other Package-Manager Records

- MacPorts - lean: installed executable or alias match | MacPorts ports tree: math/lean/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Debian apt - elan - 3.1.1-6: installed executable or alias match | Debian stable package indexes: elan from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | tool for managing installations of the Lean theorem prover | https://github.com/leanprover/elan
- Nix - elan: installed executable or alias match | nixpkgs package indexes: pkgs/by-name/el/elan/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Nix - lean: installed executable or alias match | nixpkgs package indexes: pkgs/by-name/le/lean/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - elan - 3.1.0-1build2: installed executable or alias match | Ubuntu 24.04 LTS package indexes: elan from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | tool for managing installations of the Lean theorem prover | https://github.com/leanprover/elan
- Scoop - main/elan: installed executable or alias match | Scoop official bucket manifest trees: bucket/elan.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - Lean.Elan: installed executable or alias match | Windows Package Manager source index: Lean.Elan from https://cdn.winget.microsoft.com/cache/source.msix
- winget - Lean.Lean: installed executable or alias match | Windows Package Manager source index: Lean.Lean from https://cdn.winget.microsoft.com/cache/source.msix
- winget - MPI.ELAN: installed executable or alias match | Windows Package Manager source index: MPI.ELAN from https://cdn.winget.microsoft.com/cache/source.msix


## Combined YAML source

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