{"id":8990,"date":"2021-08-09T17:24:00","date_gmt":"2021-08-09T17:24:00","guid":{"rendered":"https:\/\/linuxways.net\/?p=8990"},"modified":"2021-08-09T17:24:00","modified_gmt":"2021-08-09T17:24:00","slug":"how-to-install-kubectl-on-linux-mint-20","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/mint\/how-to-install-kubectl-on-linux-mint-20\/","title":{"rendered":"How to Install Kubectl on Linux Mint 20"},"content":{"rendered":"<h2>Introduction:<\/h2>\n<p>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\u2019s discussion is to walk you through the method of installing Kubectl on a Linux Mint 20 machine.<\/p>\n<h2>Install Kubectl on Linux Mint 20:<\/h2>\n<p>To install the Kubernetes command-line tool on your Linux system, you need to perform the following steps:<\/p>\n<h3>Step # 1: Install all the Required Packages and Dependencies:<\/h3>\n<p>First, you should install some required packages and dependencies before installing Kubectl on your system with the help of the command shown below:<\/p>\n<pre><strong>$ sudo apt-get install \u2013y apt-transport-https ca-certificates curl<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"645\" height=\"43\" class=\"wp-image-8991\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-46.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-46.png 645w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-46-300x20.png 300w\" sizes=\"auto, (max-width: 645px) 100vw, 645px\" \/><\/strong><\/p>\n<h3>Step # 2: Download the Relevant Public Key:<\/h3>\n<p>Now, you need to download the Google Cloud public signing key on your Linux system with the following command:<\/p>\n<pre><strong>$ sudo curl \u2013fsSLo \/usr\/share\/keyrings\/kubernetes-archive-keyring.gpg https:\/\/packages.cloud.google.com\/apt\/doc\/apt-key.gpg<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"645\" height=\"43\" class=\"wp-image-8992\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-47.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-47.png 645w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-47-300x20.png 300w\" sizes=\"auto, (max-width: 645px) 100vw, 645px\" \/><\/strong><\/p>\n<h3>Step # 3: Add the Kubernetes Repository to your System:<\/h3>\n<p>After that, you need to add the Kubernetes repository to your system by executing the command shown below:<\/p>\n<pre><strong>$ echo \u201cdeb [signed-by=\/usr\/share\/keyrings\/kubernetes-archive-keyring.gpg] https:\/\/apt.kubernetes.io\/ kubernetes-xenial main\u201d | sudo tee \/etc\/apt\/sources.list.d\/kubernetes.list<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"647\" height=\"61\" class=\"wp-image-8993\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-48.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-48.png 647w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-48-300x28.png 300w\" sizes=\"auto, (max-width: 647px) 100vw, 647px\" \/><\/strong><\/p>\n<p>The message shown in the following image will be displayed upon the successful addition of the Kubernetes repository to your system:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"648\" height=\"109\" class=\"wp-image-8994\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-49.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-49.png 648w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-49-300x50.png 300w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/p>\n<h3>Step # 4: Fix all the Broken Links and Dependencies:<\/h3>\n<p>Now, you need to fix all the broken links and dependencies by updating your system with the command shown below:<\/p>\n<pre><strong>$ sudo apt-get update<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"398\" height=\"24\" class=\"wp-image-8995\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-50.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-50.png 398w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-50-300x18.png 300w\" sizes=\"auto, (max-width: 398px) 100vw, 398px\" \/><\/strong><\/p>\n<h3>Step # 5: Install Kubectl on your System:<\/h3>\n<p>Finally, you can install Kubectl on your system by running the following command:<\/p>\n<pre><strong>$ sudo apt-get install \u2013y kubectl<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"495\" height=\"24\" class=\"wp-image-8996\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-51.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-51.png 495w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-51-300x15.png 300w\" sizes=\"auto, (max-width: 495px) 100vw, 495px\" \/><\/strong><\/p>\n<h3>Step # 6: Inquire the Version of Kubectl on your System:<\/h3>\n<p>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:<\/p>\n<pre><strong>$ kubectl version<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"365\" height=\"23\" class=\"wp-image-8997\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-52.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-52.png 365w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-52-300x19.png 300w\" sizes=\"auto, (max-width: 365px) 100vw, 365px\" \/><\/strong><\/p>\n<p>The version of Kubectl is shown in the following image:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"645\" height=\"140\" class=\"wp-image-8998\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-53.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-53.png 645w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-53-300x65.png 300w\" sizes=\"auto, (max-width: 645px) 100vw, 645px\" \/><\/p>\n<h2>Remove Kubectl from Linux Mint 20:<\/h2>\n<p>If you wish to remove Kubectl from your system, then you will have to perform the two steps shown below:<\/p>\n<h3>Step # 1: Remove Kubectl from your System:<\/h3>\n<p>First, you need to uninstall Kubectl from your system with the help of the following command:<\/p>\n<pre><strong>$ sudo apt-get purge --autoremove kubectl<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"560\" height=\"23\" class=\"wp-image-8999\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-54.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-54.png 560w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-54-300x12.png 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/strong><\/p>\n<h3>Step # 2: Remove all the Extra Installed Packages and Dependencies from your System:<\/h3>\n<p>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:<\/p>\n<pre><strong>$ sudo apt-get purge --autoremove apt-transport-https ca-certificates curl<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"644\" height=\"39\" class=\"wp-image-9000\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-55.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-55.png 644w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-55-300x18.png 300w\" sizes=\"auto, (max-width: 644px) 100vw, 644px\" \/><\/strong><\/p>\n<h2>Conclusion:<\/h2>\n<p>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.<\/p>","protected":false},"excerpt":{"rendered":"<p>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.&hellip;<\/p>","protected":false},"author":1,"featured_media":9161,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[466,129],"class_list":["post-8990","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mint","tag-kubectl","tag-linux-mint-20"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/8990","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=8990"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/8990\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/9161"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=8990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=8990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=8990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}