// Module included in the following assemblies:
//
// * cli_reference/openshift_cli/getting-started.adoc

[id="cli-installing-cli-rpm_{context}"]
= Installing the CLI by using an RPM

For {op-system-base-full}, you can install the OpenShift CLI (`oc`) as an RPM if you have an active {product-title} subscription on your Red Hat account.

.Prerequisites

* Must have root or sudo privileges.

.Procedure

. Register with Red Hat Subscription Manager:
+
[source,terminal]
----
# subscription-manager register
----

. Pull the latest subscription data:
+
[source,terminal]
----
# subscription-manager refresh
----

. List the available subscriptions:
+
[source,terminal]
----
# subscription-manager list --available --matches '*OpenShift*'
----

. In the output for the previous command, find the pool ID for an {product-title} subscription and attach the subscription to the registered system:
+
[source,terminal]
----
# subscription-manager attach --pool=<pool_id>
----

. Enable the repositories required by {product-title} {product-version}.

** For Red Hat Enterprise Linux 8:
+
[source,terminal]
----
# subscription-manager repos --enable="rhocp-4.6-for-rhel-8-x86_64-rpms"
----

** For Red Hat Enterprise Linux 7:
+
[source,terminal]
----
# subscription-manager repos --enable="rhel-7-server-ose-4.6-rpms"
----

. Install the `openshift-clients` package:
+
[source,terminal]
----
# yum install openshift-clients
----

After you install the CLI, it is available using the `oc` command:

[source,terminal]
----
$ oc <command>
----
