If you’re running Minikube on Windows 11 and encounter issues with uninstallation, you may have noticed that it’s not always a straightforward process. The “file in use” error is a common frustration, especially when you try to delete the .minikube
folder. In this guide, we will walk through the steps on how to completely uninstall Minikube and force delete the .minikube
folder, even if other processes are preventing you from doing so.
Common Issues During Minikube Uninstallation
Users typically face the following issues when trying to uninstall Minikube on Windows 11:
- Unable to delete the
.minikube
folder due to files being used by another process. - The Minikube uninstaller doesn’t remove all related files.
- Leftover virtual machines in Hyper-V are still running, consuming system resources.
- Minikube crashes or hangs frequently, prompting users to uninstall and reinstall the program.
Fortunately, with the right steps, you can completely remove Minikube from Windows 11 and resolve these errors.
Step-by-Step Guide to Uninstalling Minikube on Windows 11
1. Stop Running Minikube and Virtual Machines
Before you start the uninstallation process, you need to ensure that Minikube and its related virtual machines (VMs) are stopped. Here’s how to stop the Minikube VM:
minikube stop
If Minikube was set up using Hyper-V (the default for Windows 11), stopping the virtual machines in Hyper-V Manager can also help:
- Open Hyper-V Manager.
- Find the running Minikube VM, right-click it, and select Stop.
- After stopping the VM, close Hyper-V Manager.
2. Delete the Minikube Profile
Next, you need to delete the Minikube profile and all its associated files:
minikube delete --purge --all
This command ensures that all instances of Minikube are stopped and the profiles are removed. However, you might still encounter an error indicating that files in the .minikube
folder are being used by another process.
3. Manually Stop Hyper-V Services (If Necessary)
If you still face issues while trying to delete the .minikube
folder, you can manually stop Hyper-V services. In Windows 11, follow these steps:
- Open PowerShell as an administrator.
- Use the following commands to list and stop any running Hyper-V services:
Get-Service vmms
Stop-Service vmms
- Now try deleting the
.minikube
directory again.
4. Force Delete the .minikube Folder
Sometimes, Minikube files are locked by other processes, causing errors during deletion. To force delete the .minikube
folder, you can use Safe Mode or third-party tools. Here’s how you can proceed:
- Method 1: Delete in Safe Mode
- Restart your Windows 11 computer in Safe Mode.
- Navigate to the
.minikube
folder located inC:\Users\[YourUsername]\.minikube
. - Manually delete the
.minikube
folder.
- Method 2: Use Third-Party Software If Safe Mode doesn’t work, you can try using a third-party uninstaller like Revo Uninstaller:
- Download and install Revo Uninstaller.
- Search for “Minikube” in the program.
- Use the software to remove all associated files and directories, including the
.minikube
folder.
5. Clean Up Residual Files
Once Minikube is uninstalled, you should also delete the .kube
folder, which stores Kubernetes configuration files. Here’s how:
- Navigate to the
.kube
folder:C:\Users\[YourUsername]\.kube
- Manually delete this folder if it still exists.
6. Verify Minikube is Fully Uninstalled
To ensure that Minikube has been fully removed from your system, perform the following steps:
- Check for running VMs: Open Hyper-V Manager and verify that no Minikube VMs are left running.
- Check Program Files: Navigate to
C:\Program Files\Kubernetes
orC:\Program Files (x86)\Kubernetes
to ensure all Minikube files are deleted.
Troubleshooting Uninstallation Errors
If you still encounter errors while uninstalling Minikube on Windows 11, it could be due to lingering system processes or misconfigured system settings. Here are a few additional solutions:
- Use Task Manager to end any Minikube or Hyper-V processes still running.
- Reboot your computer after stopping services to ensure no background processes hold on to files.
- Run PowerShell as an administrator for all commands that stop services and delete files.
Conclusion
Uninstalling Minikube on Windows 11 can be challenging, especially when files are being used by other processes. By following this guide, you should be able to completely uninstall Minikube and remove the .minikube
folder. Always ensure to stop running VMs and services, and consider using Safe Mode or third-party tools if manual deletion doesn’t work.