You can install the Dart SDK using Chocolatey.
Important: These commands require administrator privileges. If you need help on starting an administrator-level command prompt, try a search like cmd admin.
To install the Dart SDK:
C:\> choco install dart-sdk
To upgrade the Dart SDK:
C:\> choco upgrade dart-sdk
Install Homebrew, and then run the following commands:
$ brew tap dart-lang/dart
$ brew install dart
Important: Make sure the Homebrew bin
directory is in your PATH
. Setting up the path correctly makes it easier to use Dart SDK commands such as dart
and dart format
. For help setting up your path, consult the Homebrew FAQ.
To upgrade when a new release of Dart is available:
$ brew upgrade dart
To switch between locally installed Dart releases, use brew switch dart <version>
. Example:
$ brew switch dart 2.12.4
Version note: The brew switch
command was removed after the 2.6 release of Homebrew. To continue using brew switch
, downgrade Homebrew to a 2.6 version:
$ cd /usr/local/Homebrew && git checkout 2.6.2
To see which versions of Dart you’ve installed:
$ brew info dart
If you’re using Debian/Ubuntu on AMD64 (64-bit Intel), you can choose one of the following options, both of which can update the SDK automatically when new versions are released.
Perform the following one-time setup:
$ sudo apt-get update
$ sudo apt-get install apt-transport-https
$ sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
$ sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
Then install the Dart SDK:
$ sudo apt-get update
$ sudo apt-get install dart
Alternatively, download Dart SDK as a Debian package in the .deb
package format.
After installing the SDK, add its bin
directory to your PATH
. For example, use the following command to change PATH
in your active terminal session:
$ export PATH="$PATH:/usr/lib/dart/bin"
To change the PATH for future terminal sessions, use a command like this:
$ echo 'export PATH="$PATH:/usr/lib/dart/bin"' >> ~/.profile