docker -d: cannot connect to the docker daemon

Imgur Recently during docker update. I've faced with the issue that the docker couldn't start daemon properly. For e.g. checking version of the docker gave me the following output:

root@ubuntu:/etc/apt/sources.list.d# docker version  
Client API version: 1.16  
Go version (client): go1.2.1  
OS/Arch (client): linux/amd64  
2015/01/23 03:55:49 Cannot connect to the Docker daemon. Is 'docker -d' running on this host?  

I've decided to try start it manually by using the command docker -d which gave me result that it can't find dockerinit: folder.
Then I've decided to remove it manually and re-install, but the result was the same. So I came up with the next solution which helped me:
1. Go to the folder /etc/apt
2. Remove all occurences of docker from sources.list.d
3. Execute command apt-get update
4. Then remove docker using the following command apt-get remove docker.io
5. And finally install it again via apt-get install docker.io