如何检查docker是由apt-get在Ubuntu安装?

我可以用curl -sSL https://get.docker.com/ | sh安装curl -sSL https://get.docker.com/ | sh curl -sSL https://get.docker.com/ | sh在unbuntu。 我读了这个脚本,发现以前的docker没有安装apt-get install docker-engine ,应该会有麻烦的。

为了改进脚本,如果docker没有通过apt-get安装,我想终止它。

我怎么知道docker是否由apt-get安装?

 Warning: the "docker" command appears to already exist on this system. If you already have Docker installed, this script can cause trouble, which is why we're displaying this warning and provide the opportunity to cancel the installation. If you installed the current Docker package using this script and are using it again to update Docker, you can safely ignore this message. You may press Ctrl+C now to abort this script. 

apt-get主要用于安装和更新。
sudo dpkg -l | grep docker列出你安装的docker软件包 sudo dpkg -l | grep docker

我希望这是你的意思。