2.1.3. Linux

Installation for Linux

The straight-forward way to installing oc on your system is to install by downloading the binary. This is what we are going to do step by step:

  1. First, download oc. The following URL directly points to the latest stable oc version:

    https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz

  2. Change into the directory in which you downloaded the file. Unpack the archive:

    tar xvzf openshift-client-linux.tar.gz
    
  3. Place the oc binary in a directory that is on your PATH.

  1. If you have previously accessed a Kubernetes cluster you have to rename your .kube directory.

    Check if you have a directory ~\.kube and rename it to something like ~\.kube_backup. You can undo this after the training.

Completion for Bash and Zsh (optional)

You can activate Bash completion:

source <(oc completion bash)

As well as for Zsh:

source <(oc completion zsh)

To make it permanent, you can put that command in your Bash configuration file:

echo "source <(oc completion bash)" >> ~/.bashrc

On most Linux systems, you have to install the bash-completion package to make the completion work.

Debian/Ubuntu:

sudo apt install bash-completion

Fedora:

sudo dnf install bash-completion

Login

Now, head over to the 2.2. Console login page.