I wanted to uninstall docker from my CentOs Machine and run this script :

 curl -sSL https://get.docker.com/ | sh

But it told me that the docker command was already available on the system and it could cause problems if I chose to continue the script. So I deleted /usr/bin/docker but when I ran the script it didn't reinstall /usr/bin/docker. So basically, docker is installed but I can't run it.

I tried to reinstall it with yum but it didn't succeed. I don't have the docker command in /usr/local/bin/

  • 2
    Download the appropriate RPM that contains the /usr/bin/docker, convert to .tar.gz file using alien, extract it, and manually replace the file you manually deleted. Should you need to remove the installed RPM(s) for docker, do it properly using the rpm or yum commands as appropriate.
    – ivanivan
    May 2, 2019 at 15:30
  • How do you find the appropriate RPM?
    – xaoc2nd
    May 3, 2019 at 8:31

1 Answer 1


For people who encouter the same problem : here is the solution :

1) Delete properly docker : sudo yum remove docker-ce

2) Download docker rpm : https://download.docker.com/linux/centos/7/x86_64/stable/Packages/

3) Install alien : sudo yum install alien

4) Convert rpm to tgz : alien --to-tgz package.rpm

5) Look for the /usr/bin/docker file : tar -tf package.tgz

6) Exctract the /usr/bin/docker file : tar xf package.tgz ./usr/bin/docker

7) copy to /usr/bin/docker the extracted file

8) test the docker command : docker -v

Encountered error :

docker: error while loading shared libraries: libltdl.so.7: cannot open shared object file: No such file or directory

Troubleshoot :

sudo yum install -y libtool-ltdl

Much thanks to ivanivan, hope this post helped

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .