5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Dart SDKのインストール手順

Last updated at Posted at 2020-11-02

はじめに

Dart SDKのインストール方法についてまとめています。

チャンネル

Dart SDKはStable, Beta, Devの3つのチャンネルを持ちます。

チャンネル 用途
Stable 安定版。3ヶ月に一度のリリース
Beta 安定版リリース前のプレビュー版。1ヶ月に一度のリリース
Dev リポジトリのmasterに割と近い内容が入った開発版。2週に1度のリリース

Linux (Ubuntu) 環境の場合

準備

$ sudo apt update
$ sudo apt install apt-transport-https
$ sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'

sources.listの取得

# Stable版
$ 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'

# 以下、Beta, Dev版を欲しければ追加
# Beta版
$ sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_testing.list > /etc/apt/sources.list.d/dart_testing.list'

# Dev版
$ sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_unstable.list > /etc/apt/sources.list.d/dart_unstable.list'

インストール

$ sudo apt update

最新版をインストールする

$ sudo apt install dart

以下、チャンネルを指定してインストールする方法

# installs the latest dev dart
$ sudo apt install -t unstable install dart

# installs the latest beta dart
$ sudo apt -t testing install dart

# installs the latest stable dart
$ sudo apt -t stable install dart

バージョン指定してインストールする方法

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

パス設定

パスを設定します(自身の環境に合わせて恒久的な方法で設定して下さい)

$ export PATH=$PATH:/usr/lib/dart/bin

macOS 環境の場合

インストール

$ brew tap dart-lang/dart

# Stable版
$ brew install dart

# Beta版
$ brew install dart-beta

# Dev版
$ brew install --head dart

バージョン変更

$ brew switch dart 2.10.1

参考文献

5
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?