Skip to content

Commit

Permalink
Adds uninstall (#5826)
Browse files Browse the repository at this point in the history
Fixes #3187
Fixes #5829

---------

Co-authored-by: Parker Lougheed <[email protected]>
  • Loading branch information
atsansone and parlough authored May 31, 2024
1 parent 237539c commit de510b2
Show file tree
Hide file tree
Showing 5 changed files with 190 additions and 84 deletions.
118 changes: 118 additions & 0 deletions src/_includes/install/linux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@

### Install using a Linux package manager {:.no_toc}

You have two options to install the Dart SDK on Ubuntu or Debian:

* Use the [apt-get](#install-using-the-apt-get-package-manager) command.
* Download a [`.deb`](#install-as-a-debian-package) package
and run the `dpkg` command.

### Install using the `apt-get` package manager {:.no_toc}

To install Dart with `apt-get`, perform the following steps.
You need steps 1 to 3 only for the first install.

1. Update the package index files and install the secure HTTP package.

```console
$ sudo apt-get update && sudo apt-get install apt-transport-https
```

1. Download and add the Google Linux GPG public key.

```console
$ wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub \
| sudo gpg --dearmor -o /usr/share/keyrings/dart.gpg
```

1. Add the Dart package repository to your Linux system.

```console
$ echo 'deb [signed-by=/usr/share/keyrings/dart.gpg arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main' \
| sudo tee /etc/apt/sources.list.d/dart_stable.list
```

1. Use the following `sudo apt-get` commands.

```console
$ sudo apt-get update && sudo apt-get install dart
```

### Install as a Debian package {:.no_toc}

To install the Dart SDK as a Debian package (`*.deb`),
perform the following steps.

1. Download the Dart SDK [Debian package](#){:.debian-link-stable}.

1. Use the `sudo dpkg` command to install the `*.deb` package.

```console
$ sudo dpkg -i dart_3.4.0-1_amd64.deb
```

Substitute `dart_3.4.0-1_amd64.deb` with the current filename.

## Upgrade the Dart SDK {:.no_toc}

Use the same command that you used to install the SDK.

### Upgrade using `apt-get` {:.no_toc}

If you installed the Dart SDK with `apt-get`,
use the following `sudo apt-get` commands.

```console
$ sudo apt-get update && sudo apt-get install dart
```

### Upgrade using `dpkg` {:.no_toc}

If you installed the Dart SDK with `dpkg`,
use the `sudo dpkg` command.

```console
$ sudo dpkg -i dart_3.2.6-1_amd64.deb
```

Substitute `dart_3.4.0-1_amd64.deb` with the new upgrade's filename.

## Uninstall the Dart SDK {:.no_toc}

### Uninstall using `apt-get` {:.no_toc}

If you installed the Dart SDK with `apt-get`,
use the `sudo apt-get remove` command.

1. Use the `sudo apt-get remove` command.

```console
$ sudo apt-get remove -y dart
```

1. Remove the Dart configuration files from your home directory.

```console
$ rm -rf ~/.dart*
```

### Uninstall using `dpkg` {:.no_toc}

If you installed the Dart SDK with `dpkg`,
use the `sudo dpkg --purge` command.

1. Use the `sudo dpkg --purge` command.

```console
$ sudo dpkg --purge dart
```

This removes the configuration files at the same time.

1. Verify the SDK has been removed.

```console
$ dpkg -l | grep dart
```

[sudo]: https://www.sudo.ws/
21 changes: 20 additions & 1 deletion src/content/get-dart/_mac.md → src/_includes/install/macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ To install the Dart SDK, use [Homebrew][].
Verify that your `PATH` includes the **Homebrew `bin` directory**.
Setting up the correct path simplifies using Dart SDK commands
such as `dart run` and `dart format`.

To get help configuring your `PATH`, consult the [Homebrew FAQ][].

### Upgrade using Homebrew {:.no_toc}
Expand All @@ -48,7 +49,9 @@ To switch between locally installed Dart releases:
unlink the current version and link the desired version.

```console
$ brew unlink dart@<old> && brew unlink dart@<new> && brew link dart@<new>
$ brew unlink dart@<old> \
&& brew unlink dart@<new> \
&& brew link dart@<new>
```

### List installed Dart versions {:.no_toc}
Expand All @@ -59,6 +62,22 @@ To see which versions of Dart you've installed:
$ brew info dart
```

### Uninstall using Homebrew {:.no_toc}

To uninstall the Dart SDK, use [Homebrew][].

1. Uninstall the Dart SDK.

```console
$ brew uninstall dart
```

1. Remove the Dart configuration files from your home directory.

```dart
rm -rf ~/.dart*
```

[Homebrew]: https://brew.sh
[tap]: {{site.repo.dart.org}}/homebrew-dart
[Homebrew FAQ]: https://docs.brew.sh/FAQ#my-mac-apps-dont-find-homebrew-utilities
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
To install the Dart SDK, use [Chocolatey][Chocolatey].
Chocolatey requires [elevated permissions].

Install Chocolatey, then run a [command prompt] with elevated permissions.
1. Install Chocolatey.

```ps
C:\> choco install dart-sdk
```
1. Launch [PowerShell][] with elevated permissions.

```ps
PS C:\> choco install dart-sdk
```

### Change default install path {:.no_toc}

Expand All @@ -21,7 +23,7 @@ environment variable to your desired installation directory.
Verify you can run Dart.

```ps
C:\> dart --version
PS C:\> dart --version
Dart SDK version: 3.2.4 (stable) (Thu Dec 21 19:13:53 2023 +0000) on "win_x64"
```

Expand All @@ -38,13 +40,32 @@ add the SDK location to your PATH:

### Upgrade using Chocolatey {:.no_toc}

To upgrade the Dart SDK:
To upgrade the Dart SDK, use the following command.

```ps
C:\> choco upgrade dart-sdk
PS C:\> choco upgrade dart-sdk
```

### Uninstall using Chocolatey {:.no_toc}

To uninstall the Dart SDK, perform the following steps.

1. Launch [PowerShell][] with elevated permissions.

1. Use the following command.

```ps
PS C:\> choco uninstall dart-sdk
```

1. Remove the Dart configuration files from your home directory.

```ps
PS C:\> Remove-Item -Recurse -Force ^
-Path $env:LOCALAPPDATA\.dartServer,$env:APPDATA\.dart,$env:APPDATA\.dart-tool
```

[elevated permissions]: https://www.thewindowsclub.com/elevated-privileges-windows
[command prompt]: https://www.thewindowsclub.com/how-to-run-command-prompt-as-an-administrator
[PowerShell]: https://www.thewindowsclub.com/how-to-open-an-elevated-powershell-prompt-in-windows-10
[Chocolatey]: https://chocolatey.org
[`ChocolateyToolsLocation`]: https://stackoverflow.com/questions/19752533/how-do-i-set-chocolatey-to-install-applications-onto-another-drive/68314437#68314437
53 changes: 0 additions & 53 deletions src/content/get-dart/_linux.md

This file was deleted.

45 changes: 23 additions & 22 deletions src/content/get-dart/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,49 +52,50 @@ To install and update the Dart SDK from the stable channel,
choose one of the following options:

1. [Use a package manager](#install) (Recommended).
1. Use a [Dart Docker image][dart-docker]
1. Download from the [SDK Archive](/get-dart/archive)
1. [Install Flutter][install-flutter]
1. [Build the SDK from source][build-source]

{% comment %}
NOTE to editors: Keep the zip file link as the last thing in the paragraph,
so it's easy to find (but not more tempting than package managers).
{% endcomment %}
1. Use a [Dart Docker image][dart-docker].

1. [Install Flutter][install-flutter].
If you've installed or plan to [install the Flutter SDK][install-flutter],
it includes the full Dart SDK. The Flutter SDK includes the
[`dart`](/tools/dart-tool) CLI tool in Flutter's `bin` folder.

1. Download a ZIP archive from the [SDK Archive](/get-dart/archive).

1. [Build the SDK from source][build-source].

:::warning Notice
{% include './archive/_sdk-terms.md' %}
:::

If you've installed or plan to [install the Flutter SDK][install-flutter],
it includes the full Dart SDK. The Flutter SDK includes the
[`dart`](/tools/dart-tool) CLI tool in Flutter's `bin` folder.
{% comment %}
NOTE to editors: Keep the zip file link as the last thing in the paragraph,
so it's easy to find (but not more tempting than package managers).
{% endcomment %}

## Install the Dart SDK {:#install}

## Install the Dart SDK using a package manager {:#install}
To install the Dart SDK,
use the appropriate package manager for your development platform.

Install the Dart SDK using the package manager for your platform.
To upgrade the Dart SDK,
run the same command to install the Dart SDK from your package manager.

<ul class="tabs__top-bar">
<li class="tab-link current" data-tab="tab-sdk-install-windows">Windows</li>
<li class="tab-link" data-tab="tab-sdk-install-linux">Linux</li>
<li class="tab-link" data-tab="tab-sdk-install-mac">macOS</li>
</ul>
<div id="tab-sdk-install-windows" class="tabs__content current" markdown="1">

{% include './_windows.md' %}

{% include 'install/windows.md' %}
</div>

<div id="tab-sdk-install-linux" class="tabs__content" markdown="1">

{% include './_linux.md' %}

{% include 'install/linux.md' %}
</div>

<div id="tab-sdk-install-mac" class="tabs__content" markdown="1">

{% include './_mac.md' %}

{% include 'install/macos.md' %}
</div>

## Release channel reference {:#release-channels}
Expand Down

0 comments on commit de510b2

Please sign in to comment.