Mint

How to Install Kubectl on Linux Mint 20

How to Install Kubectl on Linux Mint 20

Introduction:

Kubectl is in fact the command-line tool for Kubernetes. It allows you to operate your Kubernetes clusters via a command-line interface by passing relevant commands through it. It is capable of deploying applications, managing the clusters, viewing their logs, etc. The aim of today’s discussion is to walk you through the method of installing Kubectl on a Linux Mint 20 machine.

Install Kubectl on Linux Mint 20:

To install the Kubernetes command-line tool on your Linux system, you need to perform the following steps:

Step # 1: Install all the Required Packages and Dependencies:

First, you should install some required packages and dependencies before installing Kubectl on your system with the help of the command shown below:

$ sudo apt-get install –y apt-transport-https ca-certificates curl

Step # 2: Download the Relevant Public Key:

Now, you need to download the Google Cloud public signing key on your Linux system with the following command:

$ sudo curl –fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg

Step # 3: Add the Kubernetes Repository to your System:

After that, you need to add the Kubernetes repository to your system by executing the command shown below:

$ echo “deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main” | sudo tee /etc/apt/sources.list.d/kubernetes.list

The message shown in the following image will be displayed upon the successful addition of the Kubernetes repository to your system:

Step # 4: Fix all the Broken Links and Dependencies:

Now, you need to fix all the broken links and dependencies by updating your system with the command shown below:

$ sudo apt-get update

Step # 5: Install Kubectl on your System:

Finally, you can install Kubectl on your system by running the following command:

$ sudo apt-get install –y kubectl

Step # 6: Inquire the Version of Kubectl on your System:

Once Kubectl has been installed successfully on your Linux Mint 20 system, you can look for its installed version by executing the command shown below:

$ kubectl version

The version of Kubectl is shown in the following image:

Remove Kubectl from Linux Mint 20:

If you wish to remove Kubectl from your system, then you will have to perform the two steps shown below:

Step # 1: Remove Kubectl from your System:

First, you need to uninstall Kubectl from your system with the help of the following command:

$ sudo apt-get purge --autoremove kubectl

Step # 2: Remove all the Extra Installed Packages and Dependencies from your System:

After uninstalling Kubectl from your system, you can additionally remove all the extra packages and dependencies that you installed earlier before installing Kubectl on your system. This can be done by running the command shown below:

$ sudo apt-get purge --autoremove apt-transport-https ca-certificates curl

Conclusion:

In this way, you can install Kubectl on your Linux system and use it to operate your Kubernetes clusters if you are fond of using the command-line interfaces. This tool is very efficient in terms of cluster management and application deployment. However, if at any stage, you feel like uninstalling this tool from your system for freeing up its memory, then we have also shared with you the relevant uninstallation method which you can follow very conveniently.

Similar Posts