I am trying to install docker and have tried in a couple different ways this far. I am starting out with a brand new installation of Raspberry Pi OS Lite - Debian Bullseye. I have tried these steps with both 32 bit and 64 bit versions of the OS. I am using a raspberry pi 3b if that matters.

After the initial flashing of the SD card I run apt update and apt upgrade, I also expand the filesystem, adjust the hostname and change the standard password - that's all. Then I move onto trying to install docker. As mentioned on their site, I should be using their convenience script:

curl -fsSL https://get.docker.com -o get-docker.sh
DRY_RUN=1 sudo sh ./get-docker.sh

Executing these commands returns the following error:

# Executing docker install script, commit: 4f282167c425347a931ccfd95cc91fab041d414f
+ sh -c apt-get update -qq >/dev/null
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sh -c mkdir -p /etc/apt/keyrings && chmod -R 0755 /etc/apt/keyrings
+ sh -c curl -fsSL "https://download.docker.com/linux/raspbian/gpg" | gpg --dearmor --yes -o /etc/apt/keyrings/docker.gpg
+ sh -c chmod a+r /etc/apt/keyrings/docker.gpg
+ sh -c echo "deb [arch=armhf signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/raspbian bullseye stable" > /etc/apt/sources.list.d/docker.list
+ sh -c apt-get update -qq >/dev/null
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends docker-ce docker-ce-cli containerd.io docker-compose-plugin >/dev/null
E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried finding some resolution to this error message but I was not able to figure anything out. What are some next steps I could try in installing docker and and docker-compose onto my raspberry pi?

Thank you very much for your help!

  • Is the error the same when you use 64bit? Dec 15, 2022 at 21:05
  • Yes, that is correct. It is the exact same error.
    – jrn
    Dec 15, 2022 at 23:11
  • 1
    by the way, the instructions are flawed, since this is NOT doing a dry run, it's actually attempting to install ... to do an actual dry run run sudo sh ./get-docker.sh --dry-run - this will show everything it wants to do Dec 15, 2022 at 23:41
  • 1
    having said that, the last two commands that would be executed are basically apt install --no-install-recommends docker-ce docker-ce-cli containerd.io docker-compose-plugin and apt install docker-ce-rootless-extras - what happens if you do that - running it manually like that, you'll see the error you are getting rather than just getting the error code Dec 15, 2022 at 23:43
  • 2
    Does this answer your question? E: Sub-process /usr/bin/dpkg returned an error code (1)
    – MatsK
    Dec 16, 2022 at 6:56

1 Answer 1


It turns out that running DRY_RUN=1 sudo sh ./get-docker.sh does not actually perform just a dry run. So whenever I ran this command, some docker parts where already installed, failing the installation on the second run, without DRY_RUN.

I had to uninstall docker using

sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-ce-rootless-extras

After that the installation worked without any issues using:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh ./get-docker.sh

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.