DOTNET-INSTALL-SCRIPT(1)
π dotnet-install scripts reference β the .NET manual, section 1
okay bestie, sit down, hydrate, because we're reading the dotnet-install manpage together and it's giving main character energy. This is the .NET manual, section 1, and the scripts in question are dotnet-install.ps1 and dotnet-install.sh. no cap, they're literally just here to install stuff for you. π«Ά
β¨ NAME β¨
dotnet-install.ps1 | dotnet-install.sh β the script that installs the .NET SDK and the shared runtime. that's it, that's the job, and it does it beautifully. π
πΈ SYNOPSIS πΈ
Windows, babes:
dotnet-install.ps1 [-Architecture <ARCHITECTURE>] [-AzureFeed]
[-Channel <CHANNEL>] [-DryRun] [-FeedCredential]
[-InstallDir <DIRECTORY>] [-JSonFile <JSONFILE>]
[-NoCdn] [-NoPath] [-ProxyAddress] [-ProxyBypassList <LIST_OF_URLS>]
[-ProxyUseDefaultCredentials] [-Quality <QUALITY>] [-Runtime <RUNTIME>]
[-SkipNonVersionedFiles] [-UncachedFeed] [-Verbose]
[-Version <VERSION>]
Get-Help ./dotnet-install.ps1
Linux/macOS girlies:
dotnet-install.sh [--architecture <ARCHITECTURE>] [--azure-feed]
[--channel <CHANNEL>] [--dry-run] [--feed-credential]
[--install-dir <DIRECTORY>] [--jsonfile <JSONFILE>]
[--no-cdn] [--no-path] [--quality <QUALITY>]
[--runtime <RUNTIME>] [--runtime-id <RID>]
[--skip-non-versioned-files] [--uncached-feed] [--verbose]
[--version <VERSION>]
dotnet-install.sh --help
and the plot twist: the bash script also reads PowerShell switches, so you can absolutely use PowerShell switches with the script on Linux/macOS systems. she's bilingual, periodt. π
π¦ DESCRIPTION π¦
The dotnet-install scripts perform a non-admin installation of the .NET SDK, which includes the .NET CLI and the shared runtime. no sudo, no drama, no "are you sure you want to allow this". iconic behavior.
There are two scripts:
- A PowerShell script that works on Windows. πͺ
- A bash script that works on Linux/macOS. π§π
[!NOTE] .NET collects telemetry data. To learn more and how to opt out, see .NET SDK telemetry. (yes bestie, it's watching, but it tells you how to make it stop.)
π Purpose π
The intended use of the scripts is for Continuous Integration (CI) scenarios, where:
- The SDK needs to be installed without user interaction and without admin rights.
- The SDK installation doesn't need to persist across multiple CI runs.
The typical sequence of events, like a little routine, a little choreography:
- CI is triggered. β‘
- CI installs the SDK using one of these scripts. π¦
- CI finishes its work and clears temporary data including the SDK installation. π§Ήβ¨
To set up a development environment or to run apps, use the installers rather than these scripts. fr fr, these scripts are for the ephemeral CI life, not for your forever laptop.
β Recommended version β
We recommend that you use the stable version of the scripts:
- Bash (Linux/macOS): <https://dot.net/v1/dotnet-install.sh>
- PowerShell (Windows): <https://dot.net/v1/dotnet-install.ps1>
π Script behavior π
Both scripts have the same behavior. they download the ZIP/tarball file from the CLI build drops and proceed to install it in either the default location or in a location specified by -InstallDir|--install-dir.
By default, the installation scripts download the SDK and install it. If you wish to only obtain the shared runtime, specify the -Runtime|--runtime argument.
By default, the script adds the install location to the $PATH for the current session. Override this default behavior by specifying the -NoPath|--no-path argument. The script doesn't set the DOTNET_ROOT environment variable.
Before running the script, install the required dependencies. please, bestie, do your homework first. π
You can install a specific version using the -Version|--version argument. The version must be specified as a three-part version number, such as 2.1.0. If the version isn't specified, the script installs the latest version.
The install scripts do not update the registry on Windows. They just download the zipped binaries and copy them to a folder. If you want registry key values to be updated, use the .NET installers. (the scripts are like, not doing all that.)
β¨ OPTIONS β¨
-Architecture|--architecture <ARCHITECTURE>β Architecture of the .NET binaries to install. Possible values are<auto>,amd64,x64,x86,arm64, andarm. The default value is<auto>, which represents the currently running OS architecture. (she just knows what she's on, queen.)-AzureFeed|--azure-feedβ Specifies the URL for the Azure feed to the installer. We recommended that you don't change this value. The default value ishttps://dotnetcli.azureedge.net/dotnet.-Channel|--channel <CHANNEL>β Specifies the source channel for the installation. The possible values are:Currentβ Most current release.LTSβ Long-Term Support channel (most current supported release).- Two-part version in
A.Bformat, representing a specific release (for example,2.1or3.0). - Three-part version in
A.B.Cxxformat, representing a specific SDK release (for example,5.0.1xxor5.0.2xx). Available since the 5.0 release.
The version parameter overrides the channel parameter when any version other than latest is used.
The default value is LTS. For more information on .NET support channels, see the .NET Support Policy (<https://dotnet.microsoft.com/platform/support/policy/dotnet-core>) page.
-DryRun|--dry-runβ If set, the script won't perform the installation. Instead, it displays what command line to use to consistently install the currently requested version of the .NET CLI. For example, if you specify versionlatest, it displays a link with the specific version so that this command can be used deterministically in a build script. It also displays the binary's location if you prefer to install or download it yourself. (a little peek behind the curtain, no commitment. π)-FeedCredential|--feed-credentialβ Used as a query string to append to the Azure feed. It allows changing the URL to use non-public blob storage accounts.--helpβ Prints out help for the script. Applies only to bash script. For PowerShell, useGet-Help ./dotnet-install.ps1.-InstallDir|--install-dir <DIRECTORY>β Specifies the installation path. The directory is created if it doesn't exist. The default value is%LocalAppData%on Windows and /usr/share/dotnet*on Linux/macOS. Binaries are placed directly in this directory.-JSonFile|--jsonfile <JSONFILE>β Specifies a path to aglobal.jsonfile that will be used to determine the SDK version. Theglobal.jsonfile must have a value forsdk:version.-NoCdn|--no-cdnβ Disables downloading from the Azure Content Delivery Network (CDN) and uses the uncached feed directly.-NoPath|--no-pathβ If set, the installation folder isn't exported to the path for the current session. By default, the script modifies thePATH, which makes the .NET CLI available immediately after install.-ProxyAddressβ If set, the installer uses the proxy when making web requests. (Only valid for Windows.)-ProxyBypassList <LIST_OF_URLS>β If set withProxyAddress, provides a list of comma-separated urls that will bypass the proxy. (Only valid for Windows.)ProxyUseDefaultCredentialsβ (in the synopsis she shows up as-ProxyUseDefaultCredentialsπ ) If set, the installer uses the credentials of the current user when using proxy address. (Only valid for Windows.)-Quality|--quality <QUALITY>β Downloads the latest build of the specified quality in the channel. The possible values are:daily,signed,validated,preview,GA. Works only in combination with channel. Not applicable forcurrentandLTSchannels and will be ignored if one of those channels is used.
For an SDK installation, use channel in A.B or A.B.Cxx format. For a runtime installation, use channel in A.B format.
The version parameter overrides the channel and quality parameters when any version other than latest is used.
Available since since the 5.0 release. (yes, it says it twice, she's just that excited. π)
-Runtime|--runtime <RUNTIME>β Installs just the shared runtime, not the entire SDK. The possible values are:dotnetβ theMicrosoft.NETCore.Appshared runtime.aspnetcoreβ theMicrosoft.AspNetCore.Appshared runtime.windowsdesktopβ theMicrosoft.WindowsDesktop.Appshared runtime.
--runtime-id <RID>[Deprecated] β Specifies the runtime identifier for which the tools are being installed. Uselinux-x64for portable Linux. (Only valid for Linux/macOS and for versions earlier than .NET Core 2.1.)
--os <OPERATING_SYSTEM>
Specifies the operating system for which the tools are being installed. Possible values are: osx, linux, linux-musl, freebsd, rhel.6. (Valid for .NET Core 2.1 and later.)
The parameter is optional and should only be used when it's required to override the operating system that is detected by the script.
-SharedRuntime|--shared-runtimeβ
[!NOTE]This parameter is obsolete and may be removed in a future version of the script. The recommended alternative is the-Runtime|--runtimeoption.
Installs just the shared runtime bits, not the entire SDK. This option is equivalent to specifying -Runtime|--runtime dotnet. (she's old, she's tired, let her rest. π)
-SkipNonVersionedFiles|--skip-non-versioned-filesβ Skips installing non-versioned files, such asdotnet.exe, if they already exist.-UncachedFeed|--uncached-feedβ Allows changing the URL for the uncached feed used by this installer. We recommended that you don't change this value.-Verbose|--verboseβ Displays diagnostics information. (spill the tea, script. β)-Version|--version <VERSION>β Represents a specific build version. The possible values are:latestβ Latest build on the channel (used with the-Channeloption).- Three-part version in
X.Y.Zformat representing a specific build version; supersedes the-Channeloption. For example:2.0.0-preview2-006120.
If not specified, -Version defaults to latest.
π EXAMPLES π
okay bestie this is the part you actually came for β copy-paste city. every single command below is verbatim, so don't go freestyling edits unless you know exactly what you're doing π
- Install the latest long-term supported (LTS) version to the default location:
Windows:
./dotnet-install.ps1 -Channel LTS
macOS/Linux:
./dotnet-install.sh --channel LTS
- Install the latest preview version of the 6.0.1xx SDK to the specified location:
Windows:
./dotnet-install.ps1 -Channel 6.0.1xx -Quality preview -InstallDir C:\cli
macOS/Linux:
./dotnet-install.sh --channel 6.0.1xx --quality preview --install-dir ~/cli
- Install the 3.0.0 version of the shared runtime:
Windows:
./dotnet-install.ps1 -Runtime dotnet -Version 3.0.0
macOS/Linux:
./dotnet-install.sh --runtime dotnet --version 3.0.0
- Obtain script and install the 2.1.2 version behind a corporate proxy (Windows only):
Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -Proxy $env:HTTP_PROXY -ProxyUseDefaultCredentials -OutFile 'dotnet-install.ps1';
./dotnet-install.ps1 -InstallDir '~/.dotnet' -Version '2.1.2' -ProxyAddress $env:HTTP_PROXY -ProxyUseDefaultCredentials;
Windows only, bestie. there is no macOS/Linux twin for this one, don't come for me π the proxy girls are built different π
- Obtain script and install .NET CLI one-liner examples:
Windows:
# Run a separate PowerShell process because the script calls exit, so it will end the current PowerShell session.
&powershell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) <additional install-script args>"
macOS/Linux:
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin <additional install-script args>
lowkey the most iconic move here is piping the script straight into bash /dev/stdin β no file left behind, no crumbs, main character energy β¨ and yeah, that PowerShell comment is doing a LOT of heavy lifting, so read it: the script calls exit, which will absolutely end your current PowerShell session. that's why it spawns a whole separate process. no cap.
π See also π
- .NET releases (https://github.com/dotnet/core/releases)
- .NET Runtime and SDK download archive (https://github.com/dotnet/core/tree/main/release-notes/download-archives)
and that's the whole page, bestie π«Ά you made it to the end, I'm so proud. the lil footer down there is where the source, the version and the date live β so if you're reading this way later and wondering how ancient this info is, that footer is your receipt. go install something cute. periodt ππΈπ¦
π¦ where this page comes from
- ubuntu jammy: dotnet-host 6.0.135-0ubuntu1~22.04.1 Β· MIT
- ubuntu jammy: dotnet-host 6.0.136-0ubuntu1~22.04.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms