Getting Started Guide
Installing .NET Core on Red Hat Enterprise Linux
Chapter 1. Install .NET Core 1.0 on Red Hat Enterprise Linux
Install Red Hat Enterprise Linux using:
Register the machine by following the appropriate steps in Registering, Unregistering, and Reregistering a System in the Red Hat Subscription Management document. You can also register the system with the following command.
# subscription-manager register
Display a list of all subscriptions that are available for your system and determine the pool ID of a subscription that provides access to the .NET Core repository.
# subscription-manager list --available
This command displays its name, unique identifier, expiration date, and other details related to it. The pool ID is listed on a line beginning with Pool Id.
Attach the subscription that provides access to the .NET Core repository. Replace pool_id with the pool ID you determined in the previous step.
# subscription-manager attach --pool=<appropriate pool ID from the above step>
Verify the list of subscriptions your system has currently attached.
# subscription-manager list --consumed
Enable the .NET Core channel for Red Hat Enterprise Linux 7. If you are using a Workstation edition of Red Hat Enterprise Linux 7, change -server- to -workstation- in the following command.
# subscription-manager repos --enable=rhel-7-server-dotnet-rpms
Install the scl tool.
# yum install scl-utils
Install .NET Core 1.0 and all of its dependencies.
# yum install rh-dotnetcore10
Enable the rh-dotnetcore10 collection environment.
$ scl enable rh-dotnetcore10 bash
This command does not persist; it creates a new shell and the
dotnetcommand is only available within that shell. If you log out, use another shell, or open up a new terminal, the enabling does not carry over. Consider permanently enabling it.
$ source scl_source enable rh-dotnetcore10
Run the following command to prove the installation succeeded.
$ dotnet --help
Create the following directory.
$ mkdir hello-world
Navigate to the following directory.
$ cd hello-world
Create a new .NET Core project.
$ dotnet new
Pull the dependencies needed for the .NET Core project.
$ dotnet restore
Run the .NET Core project.
$ dotnet run
Chapter 2. Reference Material
Appendix A. Revision History
|06/24/2016||1.0||Les Williams||Original version|
|07/27/2016||1.0||Les Williams||Revised version number to reflect top-level version and spelled out RHEL|
|08/29/2016||1.0||Les Williams||Removed Step 8 and removed command outputs from Steps 9, 11, 14, 15, and 16|
|09/23/2016||1.0||Les Williams||Revised the link for Common Language Runtime (CLR) and added a link for Common Language Infrastructure (CLI)|
|11/7/2016||1.0||Les Williams||Added references to Red Hat Enterprise Linux 7 Workstation and added a link for permanently enabling rh-dotnetcore10 bash|
|11/15/2016||1.0||Les Williams||Replaced link with the command to permanently enabling rh-dotnetcore10 bash|
|12/06/2016||1.0||Les Williams||Added RHEL variants to Step 1|