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

[id="cli-installing-cli-rpm_{context}"]
= Installing the OpenShift 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.7-for-rhel-8-x86_64-rpms"
----

** For Red Hat Enterprise Linux 7:
+
[source,terminal]
----
# subscription-manager repos --enable="rhel-7-server-ose-4.7-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>
----<commit_msg>BZ-2006004: Correcting version in repo names<commit_after>// Module included in the following assemblies:
//
// * cli_reference/openshift_cli/getting-started.adoc

[id="cli-installing-cli-rpm_{context}"]
= Installing the OpenShift 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.10-for-rhel-8-x86_64-rpms"
----

** For Red Hat Enterprise Linux 7:
+
[source,terminal]
----
# subscription-manager repos --enable="rhel-7-server-ose-4.10-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>
----
{'fraction_non_alphanumeric': 0.1437125748502994, 'fraction_numerical': 0.010400252127324299, 'mean_word_length': 3.66079295154185, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5198359', 'n_tokens_mistral': 1026, 'n_tokens_neox': 951, 'n_words': 311}