0

So when I according to https://docs.docker.com/engine/install/centos/ run following command

sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine

the printed message is

no match for argument docker; 
no match for argument docker-client
...(all the argument listed)

And also,after I run the command above, the docker is still there, it is not get uninstalled. When I run docker version it tell me the docker client version is 18.03.1-ce

I also tried sudo yum remove docker-ce,same thing.

What should I do to remove old docker?

Or I don't have to worry, just install the latest version? But by the site's link it tells me to first remove existing docker then install new one.

My system is centos 7.4

When I run yum list installed I didn't find any docker related file. Is that means the docker installed in the machine is not managed by yum ? And it can't get removed by yum.

2
  • If you didn't install it via Yum, Yum won't be aware of its existence
    – Gantendo
    Commented Mar 19 at 10:06
  • @Gantendo Hi, I think that may be the problem, it was installed by someone else and it was a 2018 version, hardly can we know how did they installed it. Commented Mar 19 at 10:13

1 Answer 1

1

I suspect that Docker was installed on your machine in 2018 using its static binary (ref).

First of all, we'll locate the path of docker through which you're getting the output for your version. For that, run the following command:

whereis docker

In case whereis command is not on installed on your machine, just install it using the following command:

yum install util-linux

Now, you can run whereis docker to know it's path. Let's assume that whereis gives you the following output (it will differ on your machine).

docker: /usr/bin/docker

Now, we'll check if that is a symlink or the actual binary. For that, long list that file.

ls -l /usr/bin/docker*

If it is symlink, you'll see an arrow -> pointing to its actual binary and it's file permission will begin with l in lrwxrwxrwx or whatever permission is set for that.

Remove both symlink and the original binary. In case it is not a symlink, you can directly remove the binary using the following command:

rm /usr/bin/docker*

First, run the above command with ls to ensure you're not removing any other file. Any extra space in-between the parameter of rm command will lead to removal of unwanted files. So, make sure you verify it before running.

NOTE: I'm adding * at the end of docker in ls and rm command to target all docker binaries (including its daemon, proxy, compose, and others).

Not only that, you'll have to remove all service files responsible for automatic startup of docker daemon. Once you'll do the cleanup, you'll be ready to install latest docker engine from centos official repo.

You must log in to answer this question.

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