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-linux.adoc

132 lines
5.9 KiB
Plaintext
Raw Permalink Normal View History

// Module included in the following assemblies:
//
// * cli_reference/openshift_cli/getting-started.adoc
2019-12-10 14:21:26 -05:00
// * installing/installing_aws/installing-aws-user-infra.adoc
2019-10-03 13:05:34 -04:00
// * installing/installing_aws/installing-aws-customizations.adoc
// * installing/installing_aws/installing-aws-default.adoc
// * installing/installing_aws/installing-aws-china.adoc
2020-09-17 11:58:34 -04:00
// * installing/installing_aws/installing-aws-government-region.adoc
// * installing/installing_aws/installing-aws-secret-region.adoc
2019-11-07 13:56:52 -05:00
// * installing/installing_aws/installing-aws-private.adoc
2019-11-08 15:26:26 -05:00
// * installing/installing_aws/installing-aws-vpc.adoc
// * installing/installing_aws/installing-aws-localzone.adoc
// * installing/installaing_aws/installing-aws-wavelength-zone.adoc
// * installing/installing_aws/installing-restricted-networks-aws-installer-provisioned.adoc
// * installing/installing_aws/installing-aws-outposts-remote-workers.adocs
2019-10-03 13:05:34 -04:00
// * installing/installing_azure/installing-azure-customizations.adoc
// * installing/installing_azure/installing-azure-default.adoc
2020-09-24 14:32:22 -04:00
// * installing/installing_azure/installing-azure-government-region.adoc
2019-11-22 08:24:58 -05:00
// * installing/installing_azure/installing-azure-private.adoc
2019-11-15 08:50:08 -05:00
// * installing/installing_azure/installing-azure-vnet.adoc
2020-01-30 14:13:19 -05:00
// * installing/installing_azure/installing-azure-user-infra.adoc
// * installing/installing_bare_metal/upi/installing-bare-metal.adoc
2019-10-03 13:05:34 -04:00
// * installing/installing_gcp/installing-gcp-customizations.adoc
2019-11-07 13:56:52 -05:00
// * installing/installing_gcp/installing-gcp-private.adoc
2019-10-03 13:05:34 -04:00
// * installing/installing_gcp/installing-gcp-default.adoc
2019-11-18 12:35:43 -05:00
// * installing/installing_gcp/installing-gcp-vpc.adoc
2019-12-10 14:21:26 -05:00
// * installing/installing_gcp/installing-gcp-user-infra.adoc
// * installing/installing_gcp/installing-restricted-networks-gcp-installer-provisioned.adoc
// * installing/installing_ibm_cloud/installing-ibm-cloud-customizations.adoc
// * installing/installing_ibm_cloud/installing-ibm-cloud-vpc.adoc
// * installing/installing_ibm_cloud/installing-ibm-cloud-private.adoc
// * installing/installing_ibm_cloud/installing-ibm-cloud-restricted.adoc
2019-12-10 14:21:26 -05:00
// * installing/install_config/installing-restricted-networks-preparations.adoc
// * openshift_images/samples-operator-alt-registry.adoc
// * updating/updating-restricted-network-cluster/mirroring-image-repository.adoc
// * microshift_cli_ref/microshift-oc-cli-install.adoc
// * updating/updating_a_cluster/updating_disconnected_cluster/mirroring-image-repository.adoc
// * installing/installing-nutanix-installer-provisioned.adoc
// * installing/installing-restricted-networks-nutanix-installer-provisioned.adoc
2026-01-26 20:11:17 -08:00
// * installing/installing_ibm_powervc/installing-ibm-powervc-installer-custom.adoc
// * installing/installing_ibm_powervs/installing-ibm-power-vs-private-cluster.adoc
// * installing/installing_ibm_powervs/installing-restricted-networks-ibm-power-vs.adoc
// * installing/installing_ibm_powervs/installing-ibm-powervs-vpc.adoc
// * installing/installing-restricted-networks-azure-installer-provisioned.adoc
// * installing/installing_azure/installing-restricted-networks-azure-user-provisioned.adoc
// * installing/installing_vsphere/ipi/ipi-vsphere-preparing-to-install.adoc
// * installing/installing_vsphere/upi/upi-vsphere-preparing-to-install.adoc
2024-12-05 12:44:06 +01:00
// * installing/installing_ibm_z/upi-ibm-z-preparing-to-install.adoc
// AMQ docs link to this; do not change anchor
ifeval::["{context}" == "mirroring-ocp-image-repository"]
:restricted:
endif::[]
:_mod-docs-content-type: PROCEDURE
[id="cli-installing-cli-linux_{context}"]
= Installing the OpenShift CLI on Linux
[role="_abstract"]
To manage your cluster and deploy applications from the command line, install the {oc-first} binary on Linux.
2019-10-03 13:05:34 -04:00
[IMPORTANT]
====
2025-09-03 10:31:45 +01:00
If you installed an earlier version of `oc`, you cannot use it to complete all of the commands in {product-title}.
2023-06-21 11:11:14 -05:00
Download and install the new version of `oc`.
ifdef::restricted[]
2023-06-27 12:58:52 -04:00
If you are updating a cluster in a disconnected environment, install the `oc` version that you plan to update to.
endif::restricted[]
2019-10-03 13:05:34 -04:00
====
ifdef::microshift[]
[NOTE]
====
{product-title} version numbering matches {OCP} version numbering. Use the `oc` binary that matches your {microshift-short} version and has the appropriate RHEL compatibility.
====
endif::microshift[]
.Procedure
ifdef::openshift-origin[]
. Navigate to link:https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/[https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/] and choose the folder for your operating system and architecture.
2025-12-12 14:45:18 +00:00
. Download `oc.tar.gz`.
endif::[]
2025-09-03 10:31:45 +01:00
ifndef::openshift-origin,microshift,openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
. Navigate to the link:https://access.redhat.com/downloads/content/290[Download {product-title}] page on the Red{nbsp}Hat Customer Portal.
2025-12-12 14:45:18 +00:00
2025-09-03 10:31:45 +01:00
. Select the architecture from the *Product Variant* list.
2025-12-12 14:45:18 +00:00
2025-09-03 10:31:45 +01:00
. Select the appropriate version from the *Version* list.
2025-12-12 14:45:18 +00:00
2024-11-19 15:05:13 -05:00
. Click *Download Now* next to the *OpenShift v{product-version} Linux Clients* entry and save the file.
2025-09-03 10:31:45 +01:00
endif::openshift-origin,microshift,openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
ifdef::microshift,openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
. Navigate to the link:https://access.redhat.com/downloads/content/290[Download {OCP}] page on the Red{nbsp}Hat Customer Portal.
2025-12-12 14:45:18 +00:00
2025-09-03 10:31:45 +01:00
. Select the architecture from the *Product Variant* list.
2025-12-12 14:45:18 +00:00
2025-09-03 10:31:45 +01:00
. Select the appropriate version from the *Version* list.
2025-12-12 14:45:18 +00:00
2024-11-19 15:05:13 -05:00
. Click *Download Now* next to the *OpenShift v{product-version} Linux Clients* entry and save the file.
2025-09-03 10:31:45 +01:00
endif::microshift,openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
. Unpack the archive:
2019-10-03 13:05:34 -04:00
+
2020-08-05 10:46:55 -04:00
[source,terminal]
----
2023-03-01 07:43:42 +05:30
$ tar xvf <file>
----
2025-12-12 14:45:18 +00:00
. Place the `oc` binary in a directory that is on your `PATH`.
+
To check your `PATH`, execute the following command:
+
2020-08-05 10:46:55 -04:00
[source,terminal]
----
$ echo $PATH
----
2023-09-05 13:57:08 -04:00
.Verification
2023-09-05 13:57:08 -04:00
* After you install the OpenShift CLI, it is available using the `oc` command:
+
2020-08-05 10:46:55 -04:00
[source,terminal]
----
$ oc <command>
----
ifeval::["{context}" == "mirroring-ocp-image-repository"]
:!restricted:
endif::[]