此内容没有您所选择的语言版本。

Chapter 2. Installing .NET 5.0


To install .NET on RHEL 7 you need to first enable the .NET software repositories and install the scl tool.

Prerequisites

Procedure

  1. Enable the .NET software repositories:

    $ sudo subscription-manager repos --enable=rhel-7-variant-dotnet-rpms

    Replace variant with server, workstation or hpc-node depending on what RHEL system you are running (RHEL 7 Server, RHEL 7 Workstation, or HPC Compute Node, respectively).

  2. Verify the list of subscriptions attached to your system:

    $ sudo subscription-manager list --consumed
  3. Install the scl tool:

    $ sudo yum install scl-utils -y
  4. Install .NET 5.0 and all of its dependencies:

    $ sudo yum install rh-dotnet50 -y
  5. Enable the rh-dotnet50 Software Collection environment:

    $ scl enable rh-dotnet50 bash

    You can now run dotnet commands in this bash shell session.

    If you log out, use another shell, or open up a new terminal, the dotnet command is no longer enabled.

    Warning

    Red Hat does not recommend permanently enabling rh-dotnet50 because it may affect other programs. If you want to enable rh-dotnet permanently, add source scl_source enable rh-dotnet50 to your ~/.bashrc file.

Verification steps

  • Verify the installation:

    $ dotnet --info

    The output returns the relevant information about the .NET installation and the environment.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部