How to Uninstall Minikube (Mac/Linux/Brew)

How to Uninstall Minikube (Mac/Linux/Brew)

Minikube is a lightweight Kubernetes distribution for local development and testing purposes.

Uninstalling Minikube can be necessary when you need to free up system resources or switch to a different Kubernetes solution.

Some users may want to remove Minikube to resolve conflicts with other Kubernetes tools or due to performance issues on their local machines.

When Minikube versions become outdated, uninstalling and reinstalling may be a good practice to ensure you’re using the latest features and updates.

Let us discuss how to remove Minikube from your system. Depending on your OS and installation method the way to remove Minikube differs. We cover how to uninstall Minikube on Mac and Linux both with and without brew.

Uninstall Minikube on Mac

To uninstall Minikube on macOS, you can follow these steps:[1]

  1. Open a terminal and run the following command to stop your Minikube cluster:
    • minikube stop
  2. To remove Minikube’s virtual machine, run this command:
    • minikube delete
  3. Remove the Minikube binary from your system. The binary is often located in the /usr/local/bin directory. You can remove it using the rm command:
    • sudo rm /usr/local/bin/minikube
  4. Minikube stores configuration files and data in the ~/.minikube directory. You can remove this directory and its contents to completely uninstall Minikube:
    • rm -rf ~/.minikube
  5. If you’ve created a Kubeconfig context for Minikube, you should remove it. You can do this using the kubectl command:
    • kubectl config delete-context minikube

Uninstall Minikube on Linux

To uninstall Minikube from your Linux system, you can follow these steps:

  1. Open a terminal and stop the running Minikube cluster using the following command:
    • minikube stop
  2. You can delete the Minikube cluster using the following command:
    • minikube delete
  3. If you installed Minikube using a package manager like apt, dnf, or yum, you can uninstall it using the package manager. For example, if you used apt to install Minikube, you can uninstall it with the following command:
    • sudo apt-get remove minikube
  4. If you installed Minikube manually, you might have downloaded the binary and placed it in a directory such as /usr/local/bin. In that case, you can remove it with the following command:
    • sudo rm /usr/local/bin/minikube
  5. If you want to remove Minikube’s configuration and data files, you can delete the directory .minikube in your home folder by running:
    • rm -rf ~/.minikube
  6. If you want to remove the Minikube Kubernetes cluster from your kubeconfig file, you can use the kubectl config delete-cluster and kubectl config delete-context commands. Replace your-cluster-name with the name of your Minikube cluster: [2]
    • kubectl config delete-cluster your-cluster-name
    • kubectl config delete-context your-cluster-name

Uninstall Minikube on Homebrew (brew) on Mac or Linux

To uninstall Minikube installed using Homebrew, you can use the brew command to remove it. Here are the steps to uninstall Minikube:

  1. Open your terminal.
  2. First, stop any running Minikube clusters if you have any:
    • minikube stop
  3. Now, you can uninstall Minikube using Homebrew:
    • brew uninstall minikube
  4. After running the uninstall command, you may also want to remove any residual configuration files or data associated with Minikube. You can remove the Minikube configuration directory manually if needed:
    • rm -rf ~/.minikube

References

  1. Borisov, B. (2023, October 27). How to install MiniKube on Linux: A Step-by-Step guide. Linuxiac. https://linuxiac.com/how-to-install-minikube-on-linux/ ↩︎
  2. kubectl config delete-cluster. (2024, January 6). Kubernetes. https://kubernetes.io/docs/reference/kubectl/generated/kubectl_config/kubectl_config_delete-cluster/ ↩︎
Published