<p>I want to remove Kubernetes from a Debian machine (I didn't do the setup)</p>

<p>I followed the instructions from <a href="https://stackoverflow.com/questions/44698283/how-to-completely-uninstall-kubernetes">How to completely uninstall kubernetes</a> </p>

<pre><code>kubeadm reset
sudo apt-get purge kubeadm kubectl kubelet kubernetes-cni kube*   
sudo apt-get autoremove  
sudo rm -rf ~/.kube
</code></pre>

<p>But it seems to be still installed:</p>

<pre><code># which kubeadm
/usr/local/bin/kubeadm

# which kubectl
/usr/local/bin/kubectl

# which kubelet
/usr/local/bin/kubelet
</code></pre>

<p>Also, <code>apt list --installed | grep kube*</code> does not return anything, so it make me think it was not installed via <code>apt</code></p>

<p>Do you know how to clean this machine ? Should I just <code>rm /usr/local/bin/kubectl</code> etc ? I don't really like this idea..</p>

<p>Thanks for help</p>

iAmoric
<p>The method suggested by <a href="https://stackoverflow.com/users/4749074/rib47">Rib47</a> on the answer you <a href="https://stackoverflow.com/a/49253264/12153576">indicated</a> is correct to completely remove and clean Kubernetes installed with apt-get.</p>

<p>As mentioned by <a href="https://stackoverflow.com/users/2757035/underscore-d" title="4,484 reputation">underscore_d</a>, <code>/usr/local/bin/</code> isn't the directory where the packages installed by apt-get are placed. </p>

<p>For example, when you install kubectl using apt-get, it's placed on <code>/usr/bin/kubectl</code> and that's what is going to be removed by <code>apt-get purge</code>.</p>

<p>I tested it on my kubeadm cluster lab and I don't have these files at <code>/usr/local/bin/</code>. </p>

<p>You have to revisit all the steps you followed during the install process to know how exactly these files got there. </p>

<p>If you run <code>kubeadm reset</code>, I would say it's safe to remove these files. I suggest you to check if they are being used before removing using the command fuser. This command might not be installed in your linux and you can install it by running <code>sudo apt-get install psmisc</code>. After installing you can run it as in this example: </p>

<pre><code> $ sudo fuser /usr/bin/kubelet 
/usr/bin/kubelet:    21167e
</code></pre>

<p>It means this file is being used by process number 21167. </p>

<p>Checking this process we can see what's using it:</p>

<pre><code>$ ps -aux | grep 21167
root     21167  4.1  0.5 788164 88696 ?        Ssl  08:50   0:07 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml --cgroup-driver=cgroupfs --network-plugin=cni --pod-infra-container-image=k8s.gcr.io/pause:3.2
</code></pre>

<p>If the files related to kubernetes you have under <code>/usr/local/bin/</code> are not in use, I would remove them with no worries. </p>
