dart-sdk/docs/Installing-beta-and-dev-releases-using-package-managers.md
Parker Lougheed 8716461eaf [docs] Misc minor cleanup to migrated wiki docs
Fixes a few minor issues relating to outdated links, spelling, Markdown formatting, word choice, etc.

Bug: https://github.com/dart-lang/sdk/issues/54066
Change-Id: Ic7b9b33b27d2ce2c30f9b1fe17b0bc91873ecfb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369764
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-06-05 18:43:39 +00:00

3.4 KiB

Important

This page was copied from https://github.com/dart-lang/sdk/wiki and needs review. Please contribute changes to bring it up-to-date - removing this header - or send a CL to delete the file.


These instructions supplement https://dart.dev/get-dart with additional details for how to install beta and dev releases with brew (on macOS), choco (on Windows), and apt-get (on Linux). Note that on all platforms you can also download SDK archives from all channels at https://dart.dev/tools/sdk/archive.

Installing and upgrading on macOS with Homebrew

Installing

To install a stable channel release, use the dart formula:

$ brew tap dart-lang/dart
$ brew install dart

To install a beta channel release, use the dart-beta formula:

$ brew install dart-beta

To install a dev channel release, use the dart formula and --head:

$ brew install --head dart

Upgrading

To upgrade when a new release of Dart is available run:

# On the stable channel
$ brew upgrade dart # replace dart with dart-beta if you are on the beta channel.

# On the dev channel
$ brew reinstall dart

Switching channels

When switching channels (e.g. from stable to beta), first unlink the current release:

# stable or dev to beta
$ brew unlink dart # replace dart with dart-beta if you are on the beta channel.

# dev to stable
$ brew install -f dart

Then install using the command listed under Installing above.

Installing and upgrading on Windows with Chocolatey

To use Chocolatey to install a stable release of the Dart SDK, run this command:

C:\> choco install dart-sdk

To install a beta release, run this command (you'll need the exact version number):

C:\> choco install dart-sdk --pre --version 2.8.0.20-c-011-beta

To install a dev release, run this command:

C:\> choco install dart-sdk --pre

To upgrade the Dart SDK, run this command (add --pre to upgrade the dev release):

C:\> choco upgrade dart-sdk

Installing and upgrading on Linux with apt-get

To use apt-get to install Dart SDK packages, you first need to do this one time setup:

$ apt-get -q update && apt-get install --no-install-recommends -y -q gnupg2 curl git ca-certificates apt-transport-https openssh-client && \
  curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
  curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \
  curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_testing.list > /etc/apt/sources.list.d/dart_testing.list && \
  curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_unstable.list > /etc/apt/sources.list.d/dart_unstable.list && \
  apt-get update

Then, there are multiple ways to install the different channels from apt-get:

$ apt-get -t unstable install dart # installs the latest dev dart
$ apt-get -t testing install dart # installs the latest beta dart
$ apt-get -t stable install dart # installs the latest stable dart
$ apt-get install dart # installs the latest version of dart

You can also install a specific version of Dart like this:

$ apt-get install dart=2.9.0-4.0.dev-1