dvm install <version|channel|alias>
Downloads a Dart SDK from Google's dart-archive bucket, verifies its checksum, and extracts it into
~/.dvm/versions/<version>.
dvm install 3.13.2
Installed Dart 3.13.2 to /Users/you/.dvm/versions/3.13.2
Already installed? It says so and exits 0, straight from disk:
Dart 3.13.2 is already installed at /Users/you/.dvm/versions/3.13.2
Flags#
| Flag | Effect |
|---|---|
-f, --force |
Reinstall even if the version is already present. |
What you can name#
| Argument | Behavior |
|---|---|
A version — 3.13.2 |
Installed as written, and read straight from disk if you already have it. |
A channel — stable, beta, dev |
dvm asks the archive what that channel currently means, installs it, and
records the answer
in
~/.dvm/config.json
.
|
An alias — work |
Followed locally to whatever it points at, then installed. |
Naming a channel is the one form that costs a network round trip for resolution, which is the whole reason to type it: you are asking what
stable means today.
Recording what a channel meant#
dvm install stable
writes channels.stable into ~/.dvm/config.json. This is what makes a later
dvm use stable work: version resolution answers from local files, so the concrete version is written down at install time, ready for it.
Note the asymmetry: channels.stable moves only when you name the channel.
Installing 3.13.2 by version leaves it where it is, even if 3.13.2 happens to be the current stable, so your
stable keeps meaning whatever you last asked for.
How an install is made safe#
- Download
dartsdk-<os>-<arch>-release.zipfrom the archive. -
Verify it against the sibling
.sha256sumpublished by Google. A mismatch aborts; nothing is installed. - Extract into a temporary directory under
~/.dvm/cache/. - Rename that directory into place as
~/.dvm/versions/<version>.
The rename is what makes step 4 atomic: ~/.dvm/versions/<version> appears complete or not at all. An interrupted install leaves a partial directory in
cache/, which is disposable and safe to delete at any time.
Extraction also runs an explicit chmod pass on POSIX. The zip decoder carries unix permissions without applying them, so this pass is what leaves everything under
bin/ executable.
Platforms#
Binaries exist for macos/linux/windows on x64 and
arm64, plus arm and riscv64 on Linux. dvm picks the one matching the machine it is running on.
See also#
dvm use— install and pin, in one command.dvm list-remote— what is available to install.dvm list— what is installed already.