docker-machine looks for files in the wrong path

Viewed 2395

I was instructed to uninstall docker-machine as a snap and reinstall it directly from the source. Problem is that when I run docker-machine version it throws bash: /snap/bin/docker-machine: No such file or directory ... meaning new installation of docker machine still points to the old path not to new one.

What can I do ?

2 Answers

Seems to be an obsolete bash cache.

As mentioned in the thread you can rehash your command:

hash docker-machine

clear bash cache just for your command:

hash -d docker-machine

or totally clear all the bash cache:

hash -r

It's been a while that you posted this question, but I answer for future references.

This is not an actual solution but a hack maybe.

You need to create a link between the actual path to the newly installed docker-machine and the wrong path that docker-machine is looking for installation:

$ sudo ln /usr/local/bin/docker-machine /snap/bin/docker-machine
$ docker-machine version
docker-machine version 0.16.0, build 702c267f
Related