13307 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited,

执行 

sudo apt-get install docker-ce=5:18.09.7~3-0~ubuntu-bionic docker-ce-cli=5:18.09.7~3-0~ubuntu-bionic containerd.io

命令时,出现如下错误

● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Tue 2020-09-22 09:00:48 CST; 6ms ago
     Docs: https://docs.docker.com
  Process: 13307 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
 Main PID: 13307 (code=exited, status=1/FAILURE)
dpkg: 处理软件包 docker-ce (--configure)时出错:
 installed docker-ce package post-installation script subprocess returned error exit status 1
正在处理用于 libc-bin (2.27-3ubuntu1.2) 的触发器 ...
正在处理用于 systemd (237-3ubuntu10.38) 的触发器 ...
正在处理用于 man-db (2.8.3-2ubuntu0.1) 的触发器 ...
正在处理用于 ureadahead (0.100.0-21) 的触发器 ...
在处理时有错误发生:
 docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)

原因大概是电脑系统的内核版本过低 . 

原文地址https://raspberrypi.stackexchange.com/questions/103709/installing-docker-on-raspberry-pi

根据文章 ,  总结出以下解决方案

先进行升级

sudo apt update

sudo apt upgrade

sudo apt full-upgrade

卸载之前版本

sudo apt-get remove docker docker-engine docker.io containerd runc

sudo apt autoremove


重新安装指令

sudo apt-get install     apt-transport-https     ca-certificates     curl     gnupg-agent     software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository    "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

 安装指定版本: 

sudo apt-get install docker-ce=5:18.09.8~3-0~ubuntu-bionic docker-ce-cli=5:18.09.8~3-0~ubuntu-bionic containerd.io

如果你想安装最新版的话, 就把docker-ce=5:18.09.8~3-0~ubuntu-bionic docker-ce-cli=5:18.09.8~3-0~ubuntu-bionic去掉就可以了

 

 

猜你喜欢

转载自blog.csdn.net/qq_27348837/article/details/108724439