1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/cli-installing-cli-rpm.adoc
2024-08-30 11:42:39 +00:00

90 lines
1.9 KiB
Plaintext

// Module included in the following assemblies:
//
// * cli_reference/openshift_cli/getting-started.adoc
// * microshift_cli_ref/microshift_oc_cli_install.adoc
:_mod-docs-content-type: PROCEDURE
[id="cli-installing-cli-rpm_{context}"]
= Installing the OpenShift CLI by using an RPM
For {op-system-base-full}, you can install the {oc-first} as an RPM if you have an active {product-title}
ifdef::openshift-rosa[]
(ROSA)
endif::openshift-rosa[]
subscription on your Red Hat account.
[IMPORTANT]
====
You must install `oc` for {op-system-base} 9 by downloading the binary. Installing `oc` by using an RPM package is not supported on {op-system-base-full} 9.
====
.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
ifndef::openshift-rosa[]
an {product-title}
endif::openshift-rosa[]
ifdef::openshift-rosa[]
a ROSA
endif::openshift-rosa[]
subscription and attach the subscription to the registered system:
+
[source,terminal]
----
# subscription-manager attach --pool=<pool_id>
----
. Enable the repositories required by
ifndef::openshift-rosa[]
{product-title} {product-version}.
endif::openshift-rosa[]
ifdef::openshift-rosa[]
ROSA.
endif::openshift-rosa[]
+
[source,terminal,subs="attributes+"]
----
# subscription-manager repos --enable="rhocp-{product-version}-for-rhel-8-x86_64-rpms"
----
. Install the `openshift-clients` package:
+
[source,terminal]
----
# yum install openshift-clients
----
.Verification
* Verify your installation by using an `oc` command:
[source,terminal]
----
$ oc <command>
----