If you're not interested in the old Docker version and want to install the latest stable version, remove Docker using the following command and install it from the Docker repository:
$ sudo apt-get remove docker docker-engine docker.io containerd runc
The preceding is a general command to remove Docker, docker-engine, docker.io (as these are the older version names), and runtime containers, if any were pulled or created.