Compose: -bash: /usr/bin/docker-compose: No such file or directory

Created on 3 Nov 2017  路  4Comments  路  Source: docker/compose

I installed docker-compose at /usr/local/bin/docker-compose (according to https://github.com/docker/compose/releases)

But when I tried to run it I got error "-bash: /usr/bin/docker-compose: No such file or directory" and I believe the path was set correctly. So how do I fix it ?

root@iZ2zeecbyds24gwmuvqekgZ:/usr# /usr/local/bin/docker-compose --version
docker-compose version 1.17.0, build ac53b73
root@iZ2zeecbyds24gwmuvqekgZ:/usr# docker-compose --version
-bash: /usr/bin/docker-compose: No such file or directory
root@iZ2zeecbyds24gwmuvqekgZ:/usr# echo  $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

Most helpful comment

@IamMashed try this
ln -sf /usr/local/bin/docker-compose /usr/bin/docker-compose

All 4 comments

what was the work around? having the same issue.

@IamMashed try this
ln -sf /usr/local/bin/docker-compose /usr/bin/docker-compose

that was helpful @harshitraghav, thanks. Here is what worked for me:

pip3 install --upgrade --force-reinstall --no-cache-dir docker-compose && ln -sf /usr/local/bin/docker-compose /usr/bin/docker-compose

it seems like when snapd removes the docker/docker-compose snap, some clean up is still missing in current shell. at least for executables path resolution logic. pretty boring and annoying issue. respectfully, the symblink solution looks some dirty to me. so i just prefer restart the shell (less dirty) and bye problem.

in mi opinion this is a issue with snap. i hope this can help

Was this page helpful?
0 / 5 - 0 ratings