.net运行在linux,在 Linux 发行版上安装 .NET | Microsoft Docs

在 Linux 上安装 .NETInstall .NET on Linux

01/06/2021

本文内容

.NET 在不同的 Linux 发行版上可用。.NET is available on different Linux distributions. 大多数 Linux 平台和发行版每年都有一个主要版本,并提供用于安装 .NET 的包管理器。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.

本文其余部分详细介绍了 .NET 支持的每个主要 Linux 发行版。The rest of this article is a breakdown of each major Linux distribution that .NET supports. 所有 .NET 版本在 .NET Core 版本达到支持终止日期或 Linux 发行版达到生命周期之前仍受支持。All .NET releases remain supported until either the version of .NET reaches end-of-support or the Linux distribution reaches end-of-life.

为了实现最佳兼容性,请选择长期支持版本 (LTS)。For the best compatibility, choose a long-term release (LTS) version.

不支持的版本Unsupported releases

以下 .NET 版本 ❌ 不再受到支持。The following versions of .NET are ❌ no longer supported. 这些版本的下载仍保持发布状态:The downloads for these still remain published:

3.03.0

2.22.2

2.02.0

以下部分未详细介绍这些不受支持的版本,如果你尝试安装它们,则实际数据可能有所不同。These unsupported versions aren't detailed in the sections below and your mileage may vary if you try to install them.

手动安装Manual installation

如果你不想在 Linux 上使用包管理器来安装 .NET,可以通过下列方法之一来安装 .NET: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.

AlpineAlpine

下表列出了当前支持的 .NET 版本以及支持它们的 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.

✔️ 指示 Alpine 或 .NET 版本仍受支持。A ✔️ indicates that the version of Alpine or .NET is still supported.

❌ 指示 Alpine 或 .NET 版本在该 Alpine 发行版本上不受支持。A ❌ indicates that the version of Alpine or .NET isn't supported on that Alpine release.

当 Alpine 版本和 .NET 版本都有 ✔️ 时,将支持该 OS 和 .NET 组合。When both a version of Alpine and a version of .NET have ✔️, that OS and .NET combination is supported.

AlpineAlpine

.NET Core 2.1.NET Core 2.1

.NET Core 3.1.NET Core 3.1

.NET 5.0.NET 5.0

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

✔️ 5.0✔️ 5.0

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

✔️ 5.0✔️ 5.0

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

✔️ 5.0✔️ 5.0

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

❌ 5.0❌ 5.0

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

❌ 5.0❌ 5.0

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

❌ 5.0❌ 5.0

CentOSCentOS

CentOS 7 使用 Yum 作为包管理器,CentOS 8 使用 DNF。CentOS 7 uses Yum as a package manager and CentOS 8 uses DNF.

下表列出了 CentOS 7 和 CentOS 8 上当前受支持的 .NET 版本。The following table is a list of currently supported .NET releases on both CentOS 7 and CentOS 8. 这些版本在 .NET 版本达到支持终止日期或 CentOS 版本不再受支持之前仍受支持。These versions remain supported until either the version of .NET reaches end-of-support or the version of CentOS is no longer supported.

CentOSCentOS

.NET Core 2.1.NET Core 2.1

.NET Core 3.1.NET Core 3.1

.NET 5.0.NET 5.0

✔️ 8✔️ 8

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

✔️ 5.0✔️ 5.0

✔️ 7✔️ 7

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

✔️ 5.0✔️ 5.0

DebianDebian

Debian 将 APT(高级包工具)用作包管理器。Debian uses APT (Advanced Package Tool) as a package manager.

下表列出了当前支持的 .NET 版本以及支持它们的 Debian 版本。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.

✔️ 指示 Debian 或 .NET 版本仍受支持。A ✔️ indicates that the version of Debian or .NET is still supported.

❌ 指示 Debian 或 .NET 版本在该 Debian 版本上不受支持。A ❌ indicates that the version of Debian or .NET isn't supported on that Debian release.

当 Debian 版本和 .NET 版本都有 ✔️ 时,将支持该 OS 和 .NET 组合。When both a version of Debian and a version of .NET have ✔️, that OS and .NET combination is supported.

DebianDebian

.NET Core 2.1.NET Core 2.1

.NET Core 3.1.NET Core 3.1

.NET 5.0.NET 5.0

✔️ 10✔️ 10

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

✔️ 5.0✔️ 5.0

✔️ 9✔️ 9

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

✔️ 5.0✔️ 5.0

❌ 8❌ 8

✔️ 2.1✔️ 2.1

❌ 3.1❌ 3.1

❌ 5.0❌ 5.0

FedoraFedora

Fedora 将 DNF 用作其包管理器。Fedora uses DNF as its package manager.

下表列出了当前支持的 .NET 版本以及支持它们的 Fedora 版本。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.

✔️ 指示 Fedora 或 .NET 版本仍受支持。A ✔️ indicates that the version of Fedora or .NET is still supported.

❌ 指示 Fedora 或 .NET 版本在该 Fedora 版本上不受支持。A ❌ indicates that the version of Fedora or .NET isn't supported on that Fedora release.

当 Fedora 版本和 .NET 版本都有 ✔️ 时,将支持该 OS 和 .NET 组合。When both a version of Fedora and a version of .NET have ✔️, that OS and .NET combination is supported.

FedoraFedora

.NET Core 2.1.NET Core 2.1

.NET Core 3.1.NET Core 3.1

.NET 5.0.NET 5.0

✔️ 33✔️ 33

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

✔️ 5.0✔️ 5.0

✔️ 32✔️ 32

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

✔️ 5.0✔️ 5.0

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

❌ 5.0❌ 5.0

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

❌ 5.0❌ 5.0

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

❌ 5.0❌ 5.0

✔️ 2.1✔️ 2.1

❌ 3.1❌ 3.1

❌ 5.0❌ 5.0

✔️ 2.1✔️ 2.1

❌ 3.1❌ 3.1

❌ 5.0❌ 5.0

openSUSEopenSUSE

openSUSE 将 zypper 用作包管理器。openSUSE uses zypper as the package manager.

下表列出了 openSUSE 15 上当前受支持的 .NET 版本。The following table is a list of currently supported .NET releases on openSUSE 15. 这些版本在 .NET 版本达到支持终止日期或 openSUSE 版本不再受支持之前仍受支持。These versions remain supported until either the version of .NET reaches end-of-support or the version of openSUSE is no longer supported.

openSUSEopenSUSE

.NET Core 2.1.NET Core 2.1

.NET Core 3.1.NET Core 3.1

.NET 5.0.NET 5.0

✔️ 15✔️ 15

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

✔️ 5.0✔️ 5.0

Red HatRed Hat

Red Hat Enterprise Linux (RHEL) 将 yum (RHEL 7) 和 DNF (RHEL 8) 用作包管理器。Red Hat Enterprise Linux (RHEL) uses yum (RHEL 7) and DNF (RHEL 8) as the package manager.

下表列出了 RHEL 7 和 RHEL 8 上当前受支持的 .NET 版本。The following table is a list of currently supported .NET releases on both RHEL 7 and RHEL 8. 这些版本在 .NET 达到支持终止日期或 RHEL 版本不再受到支持之前仍受支持。These versions remain supported until either the version of .NET reaches end-of-support or the version of RHEL is no longer supported.

✔️ 指示 RHEL 或 .NET 版本仍受支持。A ✔️ indicates that the version of RHEL or .NET is still supported.

❌ 指示 RHEL 或 .NET 版本在该 RHEL 版本上不受支持。A ❌ indicates that the version of RHEL or .NET isn't supported on that RHEL release.

当 RHEL 版本和 .NET 版本都有 ✔️ 时,将支持该 OS 和 .NET 组合。When both a version of RHEL and a version of .NET have ✔️, that OS and .NET combination is supported.

RHELRHEL

.NET Core 2.1.NET Core 2.1

.NET Core 3.1.NET Core 3.1

.NET 5.0.NET 5.0

✔️ 8✔️ 8

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

✔️ 5.0✔️ 5.0

✔️ 7✔️ 7

✔️ 2.1✔️ 2.1

For more information, see Install .NET on RHEL.

SLESSLES

SLES 将 zypper 用作包管理器。SLES uses zypper as the package manager.

下表列出了 SLES 12 SP2 和 SLES 15 上当前受支持的 .NET 版本。The following table is a list of currently supported .NET releases on both SLES 12 SP2 and SLES 15. 这些版本在 .NET 达到支持终止日期或 SLES 版本不再受到支持之前仍受支持。These versions remain supported until either the version of .NET reaches end-of-support or the version of SLES is no longer supported.

✔️ 指示 SLES 或 .NET 版本仍受支持。A ✔️ indicates that the version of SLES or .NET is still supported.

❌ 指示 SLES 或 .NET 版本在该 SLES 版本上不受支持。A ❌ indicates that the version of SLES or .NET isn't supported on that SLES release.

当 SLES 版本和 .NET 版本都有 ✔️ 时,将支持该 OS 和 .NET 组合。When both a version of SLES and a version of .NET have ✔️, that OS and .NET combination is supported.

SLESSLES

.NET Core 2.1.NET Core 2.1

.NET Core 3.1.NET Core 3.1

.NET 5.0.NET 5.0

✔️ 15✔️ 15

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

✔️ 5.0✔️ 5.0

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

✔️ 5.0✔️ 5.0

For more information, see Install .NET on SLES.

UbuntuUbuntu

Ubuntu 将 APT(高级包工具)用作包管理器。Ubuntu uses APT (Advanced Package Tool) as a package manager.

下表表示 Ubuntu 和 .NET 的支持状态。The following table represents the support status of Ubuntu and .NET.

✔️ 指示 Ubuntu 或 .NET 版本仍受支持。A ✔️ indicates that the version of Ubuntu or .NET is still supported.

❌ 指示 Ubuntu 或 .NET 版本在该 Ubuntu 版本上不受支持。A ❌ indicates that the version of Ubuntu or .NET isn't supported on that Ubuntu release.

当 Ubuntu 版本和 .NET 版本都有 ✔️ 时,将支持该 OS 和 .NET 组合。When both a version of Ubuntu and a version of .NET have ✔️, that OS and .NET combination is supported.

UbuntuUbuntu

.NET Core 2.1.NET Core 2.1

.NET Core 3.1.NET Core 3.1

.NET 5.0.NET 5.0

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

✔️ 5.0✔️ 5.0

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

✔️ 5.0✔️ 5.0

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

✔️ 5.0✔️ 5.0

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

❌ 5.0❌ 5.0

✔️ 2.1✔️ 2.1

❌ 3.1❌ 3.1

❌ 5.0❌ 5.0

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

✔️ 5.0✔️ 5.0

✔️ 2.1✔️ 2.1

❌ 3.1❌ 3.1

❌ 5.0❌ 5.0

✔️ 2.1✔️ 2.1

❌ 3.1❌ 3.1

❌ 5.0❌ 5.0

❌ 2.1❌ 2.1

❌ 3.1❌ 3.1

❌ 5.0❌ 5.0

✔️ 2.1✔️ 2.1

✔️ 3.1✔️ 3.1

✔️ 5.0✔️ 5.0

后续步骤Next steps

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值