How to Install Dart on Debian 13, 12 and 11

Install Dart on Debian 13, 12, and 11 using Google's official APT repository with GPG verification and test your setup.

Last updatedAuthorJoshua JamesRead time6 minGuide typeDebian

Debian does not ship Dart in its default APT repositories, so a current SDK install starts with Google’s signed package source instead of a normal Debian archive package. To install Dart on Debian with APT-managed updates, add the Dart repository, install the dart package, and verify the SDK with a small console project.

The stable APT channel is the best fit for most Debian development work because it keeps updates inside the package manager. Beta and dev suites are available for test systems, while Flutter users usually do not need a separate Dart install because the Flutter SDK includes the dart command.

Install Dart on Debian

Choose the Dart Installation Method

Use one Dart package source on a Debian system. The stable APT suite is the safest default path for routine SDK updates; pre-release suites use the same package name but should stay on development or compatibility-test machines.

PathSourceUpdate BehaviorBest ForNotes
Stable APT packageGoogle Dart APT repository, stable suiteUpdates through APTMost Debian development and production systemsRecommended complete path
Beta APT packageGoogle Dart APT repository, testing suiteUpdates through APTTesting the next Dart stable branchUse the same lifecycle commands after changing the suite
Dev APT packageGoogle Dart APT repository, unstable suiteUpdates through APTTesting recent fixes on disposable systemsUse the same lifecycle commands and expect breakage risk

The Dart SDK archive and direct .deb downloads are better for specific-version recovery or non-APT workflows. They are manual replacement paths, so the APT update and removal commands in this article do not apply to those downloads.

Keep one Dart suite enabled at a time. Mixing stable, testing, and unstable source files can make APT choose an unexpected SDK branch or report duplicate source conflicts.

Update Debian Packages

Refresh package metadata and apply pending Debian package updates before adding the third-party Dart source:

sudo apt update && sudo apt upgrade

These commands use sudo for system package changes. If your account cannot run sudo, switch to an administrator account or configure sudo access before continuing.

Install APT Repository Tools

Install the tools needed to download HTTPS resources and dearmor Google’s signing key. Minimal Debian images often include some of these packages already, but installing them explicitly keeps the repository setup predictable.

sudo apt install curl ca-certificates gpg

The curl command guide explains the download flags used in the key-import command if you want more context before piping the key into gpg.

Import the Google Linux Signing Key

APT verifies Dart packages with Google’s Linux package signing key. Download the armored public key over HTTPS, convert it to a binary keyring, and save it under /usr/share/keyrings/ so the Dart source can reference that key directly.

curl -fsSL https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo gpg --dearmor --yes -o /usr/share/keyrings/dart.gpg

Confirm that the keyring file exists, is owned by root, and is readable by APT:

stat -c '%a %U %G %n' /usr/share/keyrings/dart.gpg
644 root root /usr/share/keyrings/dart.gpg

Add the Dart APT Repository

Create a DEB822 source file for the Dart repository. Leave dart_suite=stable for normal installs; change it to testing for beta or unstable for dev only when you deliberately want a pre-release SDK.

dart_suite=stable
dart_arch=$(dpkg --print-architecture)

if ! printf '%s\n' stable testing unstable | grep -qx "$dart_suite"; then
  printf 'Unsupported Dart suite: %s\n' "$dart_suite" >&2
elif ! printf '%s\n' amd64 arm64 armhf riscv64 | grep -qx "$dart_arch"; then
  printf 'Dart APT packages are not published for %s.\n' "$dart_arch" >&2
else
  printf '%s\n' \
    'Types: deb' \
    'URIs: https://storage.googleapis.com/download.dartlang.org/linux/debian' \
    "Suites: $dart_suite" \
    'Components: main' \
    'Signed-By: /usr/share/keyrings/dart.gpg' \
    "Architectures: $dart_arch" | sudo tee /etc/apt/sources.list.d/dart.sources > /dev/null
fi

The architecture guard matches the architectures published by the Dart APT repository: amd64, arm64, armhf, and riscv64. Systems outside that list should use the SDK archive instead of writing an unsupported APT source.

Verify the Dart Repository

Refresh APT metadata and confirm that the dart package candidate comes from Google’s repository:

sudo apt update
apt-cache policy dart

A current stable-suite candidate appears in this form:

dart:
  Installed: (none)
  Candidate: 3.12.0-1
  Version table:
     3.12.0-1 500
        500 https://storage.googleapis.com/download.dartlang.org/linux/debian stable/main amd64 Packages

The exact version changes as Dart releases new SDK builds. The important checks are a non-empty Candidate line and a repository path ending in the suite you selected.

Install the Dart SDK Package

Install the Dart SDK from the enabled repository:

sudo apt install dart

The package installs the SDK under /usr/lib/dart and provides the dart command at /usr/bin/dart. It includes the Dart VM, dart compile, dart pub, dart analyze, and other SDK tools used for command-line, server, and web development.

Verify the Dart SDK

Check the installed SDK version:

dart --version
Dart SDK version: 3.12.0 (stable) (Fri May 8 01:51:14 2026 -0700) on "linux_x64"

Confirm the command path and package state when you want package-manager proof rather than only a version string:

command -v dart
dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package} ${Version}\n' dart
/usr/bin/dart
ii  dart 3.12.0-1

Dart tools can send usage metrics and crash reports to Google. Run dart --disable-analytics after installation if you do not want the local SDK to send analytics.

Create and Run a Dart Test Project

A generated console project proves more than package installation. It checks that dart create, dependency resolution, dart run, and native compilation all work from the installed SDK.

Generate a Console Project

Create a small command-line project in your home directory:

cd ~
dart create -t console my_dart_app
Creating my_dart_app using template console...

  .gitignore
  analysis_options.yaml
  CHANGELOG.md
  pubspec.yaml
  README.md
  bin/my_dart_app.dart
  lib/my_dart_app.dart
  test/my_dart_app_test.dart

Running pub get...
  Resolving dependencies...
  Downloading packages...
  Changed 48 dependencies!

Created project my_dart_app in my_dart_app! In order to get started, run the following commands:

  cd my_dart_app
  dart run

Dependency counts can change between Dart releases, so treat the file list and successful project creation as the stable success signals.

The generated project includes these useful starting points:

  • bin/my_dart_app.dart is the entry point that calls your library code.
  • lib/my_dart_app.dart stores the sample calculation used by the starter app.
  • pubspec.yaml stores package metadata, SDK constraints, and dependencies.
  • test/ contains the generated unit test for the starter project.

Run the Starter App

Enter the project directory and run the generated program:

cd ~/my_dart_app
dart run
Hello world: 42!

Change the Sample Calculation

Edit lib/my_dart_app.dart and change the generated calculate() function to return half of the original value:

int calculate() {
  return 6 * 7 ~/ 2;
}

Run the project again from ~/my_dart_app:

dart run
Hello world: 21!

Compile a Native Executable

Compile the console entry point to a native executable:

dart compile exe bin/my_dart_app.dart
Generated: /home/joshua/my_dart_app/bin/my_dart_app.exe

Your path will use your Linux account name and the directory where you created the project.

Run the compiled executable:

bin/my_dart_app.exe
Hello world: 21!

Manage Dart on Debian

Update the Dart SDK

Dart updates arrive through APT for the enabled repository suite. Use a normal package refresh, then upgrade the installed dart package.

sudo apt update
sudo apt install --only-upgrade dart

If APT reports that dart is already the newest version, your enabled suite does not have a newer package for your architecture yet.

Switch Dart Release Channels

To move from stable to beta or dev, rerun the repository source block with dart_suite=testing or dart_suite=unstable, refresh APT metadata, and reinstall or upgrade dart. Move back to stable before using the SDK for production builds unless you have a specific compatibility reason to stay on a pre-release branch.

sudo apt update
apt-cache policy dart
sudo apt install dart

The apt-cache policy step should show the suite you selected, such as testing/main for beta or unstable/main for dev.

Remove Dart SDK

Remove the Dart package, then delete the source file. Remove the keyring only when no remaining APT source references it.

sudo apt remove --purge dart
sudo rm -f /etc/apt/sources.list.d/dart.sources
dart_key_in_use=0
while IFS= read -r -d '' source_file; do
  if grep -qF '/usr/share/keyrings/dart.gpg' "$source_file"; then
    dart_key_in_use=1
    break
  fi
done < <(find /etc/apt/sources.list /etc/apt/sources.list.d -type f -print0 2>/dev/null)

if [ "$dart_key_in_use" -eq 1 ]; then
  printf 'Keeping /usr/share/keyrings/dart.gpg because another APT source references it.\n'
else
  sudo rm -f /usr/share/keyrings/dart.gpg
fi
sudo apt update

Clear Bash’s command hash and verify that the command and package are gone:

hash -r
command -v dart || printf 'dart command absent\n'
dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package}\n' dart 2>/dev/null || printf 'dart package absent\n'
dart command absent
dart package absent

The next cleanup commands permanently delete local Dart cache and sample-project data from your user account. Keep any project directories you still need.

rm -rf ~/.dart ~/.dart-tool ~/.pub-cache
rm -rf ~/my_dart_app

Troubleshoot Dart on Debian

Fix NO_PUBKEY 1655A0AB68576280

The NO_PUBKEY 1655A0AB68576280 error means APT found the Dart repository but could not verify it with the expected Google signing key. Recreate the keyring, ensure it is world-readable, and refresh APT metadata.

sudo rm -f /usr/share/keyrings/dart.gpg
curl -fsSL https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo gpg --dearmor --yes -o /usr/share/keyrings/dart.gpg
sudo chmod 644 /usr/share/keyrings/dart.gpg
sudo apt update

Fix Duplicate Dart Source Conflicts

Older Dart instructions and one-line APT examples often create /etc/apt/sources.list.d/dart_stable.list. If that file exists beside dart.sources, APT can see duplicate repository entries or conflicting Signed-By settings.

grep -R "download.dartlang.org/linux/debian" /etc/apt/sources.list /etc/apt/sources.list.d/ 2>/dev/null

If the search shows both dart.sources and an older dart_stable.list file, remove the older file and refresh APT:

sudo rm -f /etc/apt/sources.list.d/dart_stable.list
sudo apt update

Fix Dart Command Not Found

If dart --version returns command not found, first check whether the shell can find the binary and whether the package is installed:

hash -r
command -v dart || printf 'dart command absent\n'
dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package} ${Version}\n' dart 2>/dev/null || printf 'dart package absent\n'

If the package is absent, repeat the install step. If dpkg-query shows ii dart but the command is still missing, reinstall the package to restore the managed files:

sudo apt reinstall dart

Check Unsupported Architectures

The Dart APT repository publishes packages for amd64, arm64, armhf, and riscv64. Check your Debian architecture if the source block does not create dart.sources or APT shows no candidate.

dpkg --print-architecture

Use the official Dart archive when your architecture is outside the published APT set, or when you need a specific SDK build that should not track an APT suite.

Dart projects usually need an editor and version control once they move beyond a quick SDK check. Install Visual Studio Code on Debian for Dart extension support, or install Git on Debian before cloning and managing project repositories.

For mobile, desktop, or full Flutter application work, install Flutter from the official Flutter documentation instead of installing Dart separately. For language and SDK references, use the official Dart documentation.

Conclusion

Dart is installed from Google’s signed APT repository, the dart command is available, and the sample console project proves both run and compile paths. Keep the stable suite for production work, reserve beta or dev suites for test systems, and remove the source file with the package when the SDK is no longer needed.

Share this guide

Help another Linux user troubleshoot faster

Share this guide with someone troubleshooting Linux systems or saving it for later.

Follow LinuxCapable

Want more LinuxCapable guides in Google?

Add LinuxCapable as a preferred source so Google can show more of our fresh Linux tutorials in Top Stories and From your sources when relevant.

Add LinuxCapable as a preferred source on Google
Search LinuxCapable

Need another guide?

Search LinuxCapable for package installs, commands, troubleshooting, and follow-up guides related to what you just read.

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffeeBuy me a coffee
Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed in published comments:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<blockquote>quote</blockquote> quote block

Got a Question or Feedback?

We read and reply to every comment - let us know how we can help or improve this guide.

Verify before posting: