This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.第 2 章 Installing the CLI by downloading the binary
You can install the OpenShift CLI (oc) in order to interact with OpenShift Container Platform from a command-line interface. You can install oc on Linux, Windows, or macOS.
If you installed an earlier version of oc, you cannot use it to complete all of the commands in OpenShift Container Platform 4.5. Download and install the new version of oc.
2.1. Installing the CLI on Linux 复制链接链接已复制到粘贴板!
You can install the OpenShift CLI (oc) binary on Linux by using the following procedure.
Procedure
- Navigate to the Infrastructure Provider page on the Red Hat OpenShift Cluster Manager site.
- Select your infrastructure provider, and, if applicable, your installation type.
- In the Command line interface section, select Linux from the drop-down menu and click Download command-line tools.
Unpack the archive:
tar xvzf <file>
$ tar xvzf <file>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Place the
ocbinary in a directory that is on yourPATH.To check your
PATH, execute the following command:echo $PATH
$ echo $PATHCopy to Clipboard Copied! Toggle word wrap Toggle overflow
After you install the CLI, it is available using the oc command:
oc <command>
$ oc <command>