- Установка пакета SDK для .NET или среды выполнения .NET вручную
- Выпуски .NET
- Зависимости
- Зависимости RPM
- Зависимости DEB
- Общие зависимости
- Установка с помощью скрипта
- Установка вручную
- Download .NET
- .NET 5.0 (recommended)
- .NET Core 3.1
- .NET 5.0 (recommended)
- .NET Core 3.1
- .NET 5.0 (recommended)
- .NET Core 3.1
- .NET Core
- Free. Cross-platform. Open source. Supported.
- Thank You to All the Contributors
- Ready to Get Started?
- Install .NET on Linux
- Unsupported releases
- Manual installation
- Install preview versions
- Alpine
- CentOS
- Debian
- Fedora
- openSUSE
- Red Hat
- Ubuntu
Установка пакета SDK для .NET или среды выполнения .NET вручную
Платформа .NET поддерживается в Linux. В этой статье описывается установка .NET в Linux с помощью скрипта установки или посредством извлечения двоичных файлов. Список дистрибутивов, поддерживающих встроенный диспетчер пакетов, см. в разделе Установка .NET в Linux.
Также можно установить .NET с помощью пакета Snap. Дополнительные сведения см. в разделе Установка пакета SDK для .NET или среды выполнения .NET с использованием пакета Snap.
Если вы хотите разрабатывать приложения .NET, установите пакет SDK (включает среду выполнения). Если нужно просто запустить приложения, установите среду выполнения. Если вы устанавливаете среду выполнения, мы рекомендуем установить среду выполнения ASP.NET Core, так как она включает в себя среды выполнения .NET и ASP.NET Core.
Если вы уже установили пакет SDK или среду выполнения, с помощью команд dotnet —list-sdks и dotnet —list-runtimes узнайте, какие версии установлены. Дополнительные сведения см. в статье Проверка того, установлена ли платформа .NET.
Выпуски .NET
В следующей таблице перечислены выпуски .NET (и .NET Core):
✔️ Поддерживается | ❌ Не поддерживается |
---|---|
5,0 | 3.0 |
3.1 (LTS) | 2.2 |
2.1 (LTS) | 2,0 |
1,1 | |
1.0 |
Дополнительные сведения о жизненном цикле выпусков .NET см. в разделе Политика поддержки .NET Core и .NET 5.
Зависимости
В некоторых случаях, например при установке .NET вручную, некоторые зависимости могут не устанавливаться. Ниже перечислены дистрибутивы Linux, которые поддерживаются корпорацией Майкрософт и для которых может потребоваться установка зависимостей. Дополнительные сведения см. на странице, посвященной соответствующему дистрибутиву:
Общие сведения о зависимостях см. в статье об автономных приложениях Linux.
Зависимости RPM
Если ваш дистрибутив не указан в приведенном выше списке и построен на основе RPM, могут потребоваться следующие зависимости:
Если в целевой среде выполнения установлена версия OpenSSL 1.1 или более поздняя, необходимо установить compat-openssl10.
Зависимости DEB
Если ваш дистрибутив не указан в приведенном выше списке и построен на основе Debian, могут потребоваться следующие зависимости:
Общие зависимости
Для приложений .NET, использующих сборку System.Drawing.Common, необходима также следующая зависимость:
Вы можете установить последнюю версию libgdiplus, добавив в систему репозиторий Mono. Для получения дополнительной информации см. https://www.mono-project.com/download/stable/.
Установка с помощью скрипта
Сценарии dotnet-install используются для автоматизации установок пакета SDK и среды выполнения и осуществления таких установок без прав администратора. Скрипт можно скачать на странице https://dot.net/v1/dotnet-install.sh.
![ВАЖНО] Для выполнения скрипта требуется Bash.
Этот сценарий по умолчанию устанавливает последнюю версию SDK с долгосрочной поддержкой (LTS), которой сейчас является .NET Core 3.1. Чтобы установить текущий выпуск, который может не быть версией LTS, используйте параметр -c Current .
Чтобы вместо пакета SDK установить среду выполнения .NET, используйте параметр —runtime .
Вы можете установить определенную версию, указав ее в параметре -c . Следующая команда устанавливает пакет SDK для .NET 5.0.
Установка вручную
В качестве альтернативы диспетчерам пакетов можно скачать и вручную установить пакет SDK и среду выполнения. Установка вручную как правило выполняется в рамках тестирования непрерывной интеграции или в неподдерживаемом дистрибутиве Linux. В большинстве случаев разработчикам и пользователям рекомендуется использовать диспетчер пакетов.
Сначала скачайте двоичный выпуск пакета SDK или среды выполнения с одного из следующих сайтов. При установке пакета SDK для .NET не нужно устанавливать соответствующую среду выполнения:
Затем извлеките скачанный файл и используйте команду export , чтобы задать для переменной DOTNET_ROOT расположение извлеченной папки, а затем проверьте включение .NET в переменную PATH. После этого команды .NET CLI станут доступны в терминале.
Кроме того, после скачивания двоичного файла .NET можно выполнить следующие команды из каталога, в котором сохранен файл, для извлечения среды выполнения. После этого команды .NET CLI также станут доступны в терминале, и будут заданы нужные переменные среды. Обязательно измените значение DOTNET_FILE на имя скачанного двоичного файла:
Приведенные выше команды export сделают команды .NET CLI доступными только для сеанса терминала, в котором производился запуск.
Вы можете изменить профиль оболочки, чтобы добавить команды окончательно. Существует несколько различных оболочек, доступных для Linux, и каждая из них имеет свой профиль. Пример:
- Оболочка Bash:
/.bashrc
Оболочка Korn:
/.kshrc или .profile
Оболочка Z:
Измените соответствующий исходный файл оболочки и добавьте :$HOME/dotnet в конец существующего оператора PATH . Если оператор PATH не указан, добавьте новую строку с export PATH=$PATH:$HOME/dotnet .
Кроме того, добавьте export DOTNET_ROOT=$HOME/dotnet в конец файла.
Такой подход позволяет устанавливать разные версии в отдельные расположения и выбирать, какие из них следует использовать для каждого приложения.
Источник
Download .NET
Downloads for .NET and .NET Core, including ASP.NET Core
Not sure where to start? See the Hello World in 5 minutes tutorial to install .NET and build your first app.
.NET is a free, cross-platform, open-source developer platform for building many different types of applications.
.NET 5.0 (recommended)
Current Current is the most recent stable release, with the latest features and bug fixes. We recommend using this release.
.NET Core 3.1
LTS Long-term support (LTS) releases have an extended support period. Use LTS if you need to stay supported on the same version of .NET or .NET Core for longer.
.NET is a free, cross-platform, open-source developer platform for building many different types of applications.
.NET 5.0 (recommended)
Current Current is the most recent stable release, with the latest features and bug fixes. We recommend using this release.
.NET Core 3.1
LTS Long-term support (LTS) releases have an extended support period. Use LTS if you need to stay supported on the same version of .NET or .NET Core for longer.
.NET is a free, cross-platform, open-source developer platform for building many different types of applications.
.NET 5.0 (recommended)
Current Current is the most recent stable release, with the latest features and bug fixes. We recommend using this release.
.NET Core 3.1
LTS Long-term support (LTS) releases have an extended support period. Use LTS if you need to stay supported on the same version of .NET or .NET Core for longer.
.NET is a free, cross-platform, open-source developer platform for building many different types of applications.
.NET Core
Free. Cross-platform. Open source. Supported.
.NET is free. There are no fees or licensing costs, including for commercial use.
.NET is open-source and cross-platform, with free development tools for Linux, Windows, and macOS.
.NET is supported by Microsoft. Microsoft ships official releases that are built and tested on Microsoft-maintained servers in Azure and supported just like any Microsoft product.
Thank You to All the Contributors
.NET is open source and we are very thankful for the many contributions it receives from the community.
Ready to Get Started?
Our step-by-step tutorial will help you get .NET running on your computer.
Источник
Install .NET on Linux
.NET is available on different Linux distributions. Most Linux platforms and distributions have a major release each year, and most provide a package manager that is used to install .NET. This article describes what is currently supported and which package manager is used.
The rest of this article is a breakdown of each major Linux distribution that .NET supports. All .NET releases remain supported until either the version of .NET reaches end-of-support or the Linux distribution reaches end-of-life.
For the best compatibility, choose a long-term release (LTS) version.
Unsupported releases
The following versions of .NET are вќЊ no longer supported. The downloads for these still remain published:
These unsupported versions aren’t detailed in the sections below and your mileage may vary if you try to install them.
Manual installation
If you don’t want to use a package manager to install .NET on Linux, you can install .NET in one of the following ways:
Be sure to check the appropriate distribution page for more information about any required dependencies that may be missing when you do a manual installation.
Install preview versions
Preview and Release Candidate versions of .NET aren’t available in package managers. You can install previews and release candidates of .NET manually.
Alpine
The following table is a list of currently supported .NET releases and the versions of Alpine they’re supported on. These versions remain supported until either the version of .NET reaches end-of-support or the version of Alpine reaches end-of-life.
- A вњ”пёЏ indicates that the version of Alpine or .NET is still supported.
- A вќЊ indicates that the version of Alpine or .NET isn’t supported on that Alpine release.
- When both a version of Alpine and a version of .NET have вњ”пёЏ, that OS and .NET combination is supported.
Alpine | .NET Core 2.1 | .NET Core 3.1 | .NET 5.0 |
---|---|---|---|
вњ”пёЏ 3.13 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вњ”пёЏ 5.0 |
вњ”пёЏ 3.12 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вњ”пёЏ 5.0 |
вњ”пёЏ 3.11 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вњ”пёЏ 5.0 |
вњ”пёЏ 3.10 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вќЊ 5.0 |
вќЊ 3.9 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вќЊ 5.0 |
вќЊ 3.8 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вќЊ 5.0 |
CentOS
CentOS 7 uses Yum as a package manager and CentOS 8 uses DNF.
The following table is a list of currently supported .NET releases on both CentOS 7 and CentOS 8. These versions remain supported until either the version of .NET reaches end-of-support or the version of CentOS is no longer supported.
CentOS | .NET Core 2.1 | .NET Core 3.1 | .NET 5.0 |
---|---|---|---|
вњ”пёЏ 8 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вњ”пёЏ 5.0 |
вњ”пёЏ 7 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вњ”пёЏ 5.0 |
Debian
Debian uses APT (Advanced Package Tool) as a package manager.
The following table is a list of currently supported .NET releases and the versions of Debian they’re supported on. These versions remain supported until either the version of .NET reaches end-of-support or the version of Debian reaches end-of-life.
- A вњ”пёЏ indicates that the version of Debian or .NET is still supported.
- A вќЊ indicates that the version of Debian or .NET isn’t supported on that Debian release.
- When both a version of Debian and a version of .NET have вњ”пёЏ, that OS and .NET combination is supported.
Debian | .NET Core 2.1 | .NET Core 3.1 | .NET 5.0 |
---|---|---|---|
вњ”пёЏ 11 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вњ”пёЏ 5.0 |
вњ”пёЏ 10 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вњ”пёЏ 5.0 |
вњ”пёЏ 9 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вњ”пёЏ 5.0 |
вќЊ 8 | вњ”пёЏ 2.1 | вќЊ 3.1 | вќЊ 5.0 |
Fedora
Fedora uses DNF as its package manager.
The following table is a list of currently supported .NET releases and the versions of Fedora they’re supported on. These versions remain supported until either the version of .NET reaches end-of-support or the version of Fedora reaches end-of-life.
- A вњ”пёЏ indicates that the version of Fedora or .NET is still supported.
- A вќЊ indicates that the version of Fedora or .NET isn’t supported on that Fedora release.
- When both a version of Fedora and a version of .NET have вњ”пёЏ, that OS and .NET combination is supported.
Fedora | .NET Core 2.1 | .NET Core 3.1 | .NET 5.0 |
---|---|---|---|
вњ”пёЏ 34 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вњ”пёЏ 5.0 |
вњ”пёЏ 33 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вњ”пёЏ 5.0 |
вњ”пёЏ 32 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вњ”пёЏ 5.0 |
вќЊ 31 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вќЊ 5.0 |
вќЊ 30 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вќЊ 5.0 |
вќЊ 29 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вќЊ 5.0 |
вќЊ 28 | вњ”пёЏ 2.1 | вќЊ 3.1 | вќЊ 5.0 |
вќЊ 27 | вњ”пёЏ 2.1 | вќЊ 3.1 | вќЊ 5.0 |
openSUSE
openSUSE uses zypper as the package manager.
The following table is a list of currently supported .NET releases on openSUSE 15. These versions remain supported until either the version of .NET reaches end-of-support or the version of openSUSE is no longer supported.
openSUSE | .NET Core 2.1 | .NET Core 3.1 | .NET 5.0 |
---|---|---|---|
вњ”пёЏ 15 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вњ”пёЏ 5.0 |
Red Hat
Red Hat Enterprise Linux (RHEL) uses yum (RHEL 7) and DNF (RHEL 8) as the package manager.
The following table is a list of currently supported .NET releases on both RHEL 7 and RHEL 8. These versions remain supported until either the version of .NET reaches end-of-support or the version of RHEL is no longer supported.
- A вњ”пёЏ indicates that the version of RHEL or .NET is still supported.
- A вќЊ indicates that the version of RHEL or .NET isn’t supported on that RHEL release.
- When both a version of RHEL and a version of .NET have вњ”пёЏ, that OS and .NET combination is supported.
RHEL | .NET Core 2.1 | .NET Core 3.1 | .NET 5.0 |
---|---|---|---|
вњ”пёЏ 8 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вњ”пёЏ 5.0 |
вњ”пёЏ 7 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вњ”пёЏ 5.0 |
For more information, see Install .NET on RHEL.
SLES uses zypper as the package manager.
The following table is a list of currently supported .NET releases on both SLES 12 SP2 and SLES 15. These versions remain supported until either the version of .NET reaches end-of-support or the version of SLES is no longer supported.
- A вњ”пёЏ indicates that the version of SLES or .NET is still supported.
- A вќЊ indicates that the version of SLES or .NET isn’t supported on that SLES release.
- When both a version of SLES and a version of .NET have вњ”пёЏ, that OS and .NET combination is supported.
SLES | .NET Core 2.1 | .NET Core 3.1 | .NET 5.0 |
---|---|---|---|
вњ”пёЏ 15 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вњ”пёЏ 5.0 |
вњ”пёЏ 12 SP2 | вњ”пёЏ 2.1 | вњ”пёЏ 3.1 | вњ”пёЏ 5.0 |
For more information, see Install .NET on SLES.
Ubuntu
Ubuntu uses APT (Advanced Package Tool) as a package manager.
The following table represents the support status of Ubuntu and .NET.
Источник