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

## 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
- **Package manager page:** <https://formulae.brew.sh/formula/elan-init>
- **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>
- **Upstream docs:** <https://github.com/leanprover/elan#readme>
- **License:** Apache-2.0 OR MIT
- **Source archive:** <https://github.com/leanprover/elan/archive/refs/tags/v4.2.3.tar.gz>
- **Last updated:** 2026-06-13T01:24:10+02:00
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

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

## Dependencies

- coreutils
- gmp

## Build dependencies

- pkgconf
- rust

## Uses from macOS

- bzip2
- curl

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 4.2.3
- Package-manager updated: 2026-06-13
- Local data: ok
- Upstream repository: https://github.com/leanprover/elan
- Upstream latest detected: v4.2.3 (current)
## 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
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** elan-init
- **Aliases:** elan
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Conflicts With:** lean-cli
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

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


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Secret-risk packages](https://www.automicvault.com/pkg/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Language runtime packages](https://www.automicvault.com/pkg/language-runtime-packages/) - Matched language runtime, compiler, or interpreter metadata.
- [coreutils](https://www.automicvault.com/pkg/brew/coreutils/) - Runtime dependency declared by Homebrew.
- [pkgconf](https://www.automicvault.com/pkg/brew/pkgconf/) - Build dependency declared by Homebrew.
- [rust](https://www.automicvault.com/pkg/brew/rust/) - Build dependency declared by Homebrew.
- [rustup](https://www.automicvault.com/pkg/brew/rustup/) - Shares av.db curated category or tags: cli, installer, language-runtime, toolchain-manager.
- [ruby-build](https://www.automicvault.com/pkg/brew/ruby-build/) - Shares av.db curated category or tags: cli, installer, language-runtime, version-manager.
- [kerl](https://www.automicvault.com/pkg/brew/kerl/) - Shares av.db curated category or tags: cli, language-runtime, version-manager.
- [n](https://www.automicvault.com/pkg/brew/n/) - Shares av.db curated category or tags: cli, language-runtime, version-manager.
- [plenv](https://www.automicvault.com/pkg/brew/plenv/) - Shares av.db curated category or tags: cli, language-runtime, version-manager.
- [pyenv](https://www.automicvault.com/pkg/brew/pyenv/) - Shares av.db curated category or tags: cli, language-runtime, version-manager.
- [ruby-install](https://www.automicvault.com/pkg/brew/ruby-install/) - Shares av.db curated category or tags: cli, installer, language-runtime.
- [abcl](https://www.automicvault.com/pkg/brew/abcl/) - Shares av.db curated category or tags: cli, language-runtime.

## Combined YAML source

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


## Sources

- 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
