Skip to content

Commit

Permalink
Merged #9089
Browse files Browse the repository at this point in the history
  • Loading branch information
atsansone committed Sep 21, 2023
1 parent c3dbea6 commit d126729
Showing 1 changed file with 38 additions and 69 deletions.
107 changes: 38 additions & 69 deletions src/get-started/install/_get-sdk-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,129 +2,98 @@

{% include docs/china-notice.md %}

On Linux, you have two ways you can install Flutter.
Install Flutter on Linux using one of the following two methods.
After installation, verify your environment setup.

### Install Flutter using snapd
### Method 1: Install Flutter using snapd

The easiest way to install Flutter on Linux is by
using snapd. For more information,
check out [Installing snapd][].
This offers the most direct method to install Flutter on Linux.
To learn about using snapd, check [Installing snapd][].

Once you have snapd, you can
[install Flutter using the Snap Store][],
or at the command line:
After you install `snapd`, install Flutter from the Snap Store or
use the following command:

```terminal
$ sudo snap install flutter --classic
```

{{site.alert.note}}
Once you install snap,
use the following command to display your Flutter SDK path:
After you install `snapd`,
display your Flutter SDK path with the following command:

```terminal
$ flutter sdk-path
```
{{site.alert.end}}

### Install Flutter manually

If you don't have `snapd`, or can't use it,
you can install Flutter using the following steps.
{{site.alert.end}}

1. Download the following installation bundle to get the latest
{{site.sdk.channel}} release of the Flutter SDK:
### Method 2: Manual Installation

[(loading...)](#){:.download-latest-link-{{os}}.btn.btn-primary}
If you don't have or can't use `snapd`, follow these steps to install Flutter.

For other release channels, and older builds,
check out the [SDK archive][].
1. Download the installation bundle for the latest
{{site.sdk.channel}} release of the Flutter SDK:

1. Extract the file in the desired location. For example:
[(loading...)](#){:.download-latest-link-{{os}}.btn.btn-primary}

{% comment %}
Our JS also updates the filename in this template,
but it doesn't include the terminal formatting:
You can find older builds and other release channels in the [SDK archive][].

{% prettify shell %}
$ cd ~/development
$ tar xf ~/Downloads/[[download-latest-link-filename]]flutter_{{os}}_vX.X.X-{{site.sdk.channel}}.tar.xz[[/end]]
{% endprettify %}
{% endcomment -%}
2. Extract the downloaded file to a location of your choice:

```terminal
$ cd ~/development
$ tar xf ~/Downloads/flutter_{{os}}_vX.X.X-{{site.sdk.channel}}.tar.xz
```
1. Add the `flutter` tool to your path:

3. Add the `flutter` tool to your path:

```terminal
$ export PATH="$PATH:`pwd`/flutter/bin"
```

This command sets your `PATH` variable for the
_current_ terminal window only.
To permanently add Flutter to your path,
This command sets your `PATH` environment variable for the current
terminal window only.
To add Flutter as permenant part of your path,
check out [Update your path][].

1. Optionally, pre-download development binaries:

The `flutter` tool downloads platform-specific
development binaries as needed. For scenarios
where pre-downloading these artifacts is preferable
(for example, in hermetic build environments,
or with intermittent network availability), iOS
and Android binaries can be downloaded ahead of time by running:
4. (Optional) Pre-download development binaries:

```terminal
$ flutter precache
```

For additional download options,
check out `flutter help precache`.

You are now ready to run Flutter commands!
To find additional download options, run `flutter help precache`.

{{site.alert.note}}
To update an existing version of Flutter,
check out [Upgrading Flutter][].
To update an existing version of Flutter, see [Upgrading Flutter][].
{{site.alert.end}}

### Post Installation: Run flutter doctor

### Run flutter doctor
After installing Flutter, run `flutter doctor`.
This command checks your environment and displays a report in the
terminal window.
Flutter bundles the Dart SDK. You don't need to install Dart.
Review the output for further tasks to perform.

Run the following command to see if there are any
dependencies you need to install to complete the setup
(for verbose output, add the `-v` flag):
For verbose output, add the `-v` flag:

```terminal
$ flutter doctor
```

This command checks your environment and displays
a report to the terminal window.
The Dart SDK is bundled with Flutter;
it isn't necessary to install Dart separately.
Check the output carefully for other software you might
need to install or further tasks to perform (shown in **bold** text).

For example:
The output might resemble the following:

<pre>
```terminal
[-] Android toolchain - develop for Android devices
• Android SDK at /Users/dash/Library/Android/sdk
<strong>✗ Android SDK is missing command line tools; download from https://goo.gl/XxQghQ</strong>
• Try re-installing or updating your Android SDK,
visit {{site.url}}/setup/#android-setup for detailed instructions.
</pre>

The following sections describe how to perform
these tasks and finish the setup process.
```

Once you have installed any missing dependencies,
run the `flutter doctor` command again to verify
that you've set everything up correctly.
After installing any missing dependencies,
run the `flutter doctor` command again.

{% include_relative _analytics.md %}

Expand All @@ -133,4 +102,4 @@ that you've set everything up correctly.
[Installing snapd]: https://snapcraft.io/docs/installing-snapd
[SDK archive]: {{site.url}}/release/archive
[Update your path]: #update-your-path
[Upgrading Flutter]: {{site.url}}/release/upgrade
[Upgrading Flutter]: {{site.url}}/release/upgrade

0 comments on commit d126729

Please sign in to comment.