OT, mostly, RPI/Docker install issue I need help with!

Trying to install Docker on one of my PIs and I'm getting a recurring error:

E: Sub-process /usr/bin/dpkg returned an error code (1)

pi@raspberrypi:~ $ curl -sSL https://get.docker.com | sh
# Executing docker install script, commit: 3d8fe77c2c46c5b7571f94b42793905e5b3e42e4
+ sudo -E sh -c apt-get update -qq >/dev/null
+ sudo -E sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sudo -E sh -c curl -fsSL "https://download.docker.com/linux/raspbian/gpg" | apt-key add -qq - >/dev/null
Warning: apt-key output should not be parsed (stdout is not a terminal)
+ sudo -E sh -c echo "deb [arch=armhf] https://download.docker.com/linux/raspbian buster stable" > /etc/apt/sources.list.d/docker.list
+ sudo -E sh -c apt-get update -qq >/dev/null
+ [ -n  ]
+ sudo -E sh -c apt-get install -y -qq --no-install-recommends docker-ce >/dev/null
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've followed suggestions to ensure I've cleared all traces of Docker off my system and tried to reinstall but the install always ends w/the error above.

Then I get a permission error trying to run docker info, run hello-world, etc:

pi@raspberrypi:~ $ docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)

Server:
ERROR: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.24/info: dial unix /var/run/docker.sock: connect: permission denied
errors pretty printing info

I have ensure thed default user (pi) is in the docker group:

sudo usermod -aG docker pi

Checked docker status and see errors - not sure how to resolve, however:

pi@raspberrypi:~ $ sudo service docker status
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2021-03-01 16:06:47 PST; 2min 27s ago
     Docs: https://docs.docker.com
  Process: 15160 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.so
 Main PID: 15160 (code=exited, status=1/FAILURE)

Mar 01 16:06:47 raspberrypi systemd[1]: docker.service: Service RestartSec=2s expired, scheduli
Mar 01 16:06:47 raspberrypi systemd[1]: docker.service: Scheduled restart job, restart counter
Mar 01 16:06:47 raspberrypi systemd[1]: Stopped Docker Application Container Engine.
Mar 01 16:06:47 raspberrypi systemd[1]: docker.service: Start request repeated too quickly.
Mar 01 16:06:47 raspberrypi systemd[1]: docker.service: Failed with result 'exit-code'.
Mar 01 16:06:47 raspberrypi systemd[1]: Failed to start Docker Application Container Engine.
lines 1-13/13 (END)

Any suggestions? I'm stuck...

Was going through removing docker again to see if I could re-install it and try again...

Ran sudo apt-get remove --auto-remove docker and suddenly it completes with Setting up docker-ce (5:20.10.4~3-0~raspbian-buster) ... and now docker appears to work. Bizarre...but I'll take it. :slight_smile:

pi@raspberrypi:~ $ sudo apt-get remove --auto-remove docker
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'docker' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up docker-ce (5:20.10.4~3-0~raspbian-buster) ...

Have you tried these commands:

sudo apt-get purge docker-ce
apt-get clean
apt-get autoremove

Thanks for asking. Yes, had run them earlier, at least once. It's working now, finally.

I've no idea why running "sudo apt-get remove --auto-remove docker" a second (or third?) time when I was removing Docker to try to install it again, suddenly fixed Docker so it worked. Random magic happened...

1 Like

have you rebooted after removing . that error looks like a failure like it cannot bind to the port ie a version of docker or something is alreqady running on that port.. i have seen that with my qnap.

Yes, I rebooted along the way at least once. Not sure how many times, frankly.

But things are working now so I'll never touch it again. :wink:

1 Like

FWIW, this is what I was setting up for my "dumb" Ecovacs Deebot N79 - works great!