Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker stopped working: Failed to install symlinks in /usr/local/bin (stage 4)

Tags:

docker

All of a sudden today Docker on my Mac stopped working with a 'failed to install symlinks"

I tried to get back to a clean state by uninstalling Docker and trying to remove all symlinks in the /usr/local/bin. I'm left with two simlinks docker-compose and docker-machine that I cannot remove even with sudo.

Any suggestion on how to delete those files (that I suspect are the root of the problem) so I can do a clean install?

Not sure if helps but 'Macfee Endpoint security' is running on my Mac.

like image 244
Clca Avatar asked Dec 02 '17 08:12

Clca


2 Answers

I recently have the same problem on my mac.

I resolved it by changing the owner of /usr/local/bin by the current user like that:

# sudo chown -R $(whoami) /usr/local/bin

like image 172
Geoffroy Avatar answered Nov 16 '22 15:11

Geoffroy


This is possibly a broken symlink. Please use this command to find if it’s pointing to an existing parent file:

# ls -lh file

From the output of the command above, if it points to broken parent file, then force the removal of that file first as root:

# rm -rf <broken-referenced-file>

And then unlink the binary symlinks:

# unlink <file>

Also make sure there is no running process related to docker and that no open files are being held by any docker associated process. To get a list of open files do this:

# lsof | grep deleted
# lsof | grep -i docker 
# lsof | grep deleted | grep -i docker

Compare the outputs to see if there are any for docker; if so, kill the process using:

# kill -SIGKILL <PID>

And again try unlinking.

like image 2
Gaby Weiss Avatar answered Nov 16 '22 15:11

Gaby Weiss