To solve your issue you have to use curl, you can follow the commands mentioned below:
sudo curl -sSL http://getdocker/ | sh
The above command will execute a code that installs docker.
After completing the above step update Docker run by the below-mentioned command:
sudo apt-get update && apt-get upgrade
Also, make sure that you use docker.io instead of docker.
sudo apt-get install docker.io