如何在ubuntu中通过apt-get检查docker是否安装?

fir*_*lyu 0 ubuntu apt-get docker

我可以curl -sSL https://get.docker.com/ | sh在 Ubuntu 中安装 docker 。看了脚本,发现如果之前docker没有安装过apt-get install docker-engine,应该是有问题。

为了提高剧本,我想终止它,如果docker没有被安装apt-get

我怎么知道dockerin是否安装了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.
Run Code Online (Sandbox Code Playgroud)

Eld*_*sis 7

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

我希望这就是你的意思。