I'm trying to install docker on raspberry pi running Raspbian bullseye but I am running into a wall related to iptables. I have tried various methods mentioned at https://docs.docker.com/engine/install/debian/ but unfortunately they all return the same error.

pi@raspberrypi:~ $  sudo apt-get install docker-ce docker-ce-cli containerd.io
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 iptables : Depends: libip4tc2 (= 1.8.5-2) but 1.8.7-1 is to be installed
            Depends: libxtables12 (= 1.8.5-2) but 1.8.7-1 is to be installed
E: Unable to correct problems, you have held broken packages.

I tried upgrading both libip4tc2 but the error I get is that the latest version is installed.

pi@raspberrypi:~ $ sudo apt-get upgrade libip4tc2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libip4tc2 is already the newest version (1.8.7-1).
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

What am I doing wrong?

  • the problem is that the dependency is for version = 1.8.5-2 ... but you have a later version installed - though, that doesn't make sense since my install of docker works with 1.8.7-1
    – Bravo
    Jan 17, 2022 at 11:38
  • There is no docker-ce in Raspberry Pi OS -Bullseye
    – Milliways
    Jan 17, 2022 at 11:40
  • @Milliways - there is if you add the docker.com repository
    – Bravo
    Jan 17, 2022 at 11:46
  • you have held broken packages - so don't hold them
    – Bravo
    Jan 17, 2022 at 11:47
  • pi@raspberrypi:~ $ sudo dpkg --get-selections | grep hold returns no entries
    – Gaurav
    Jan 17, 2022 at 14:43

1 Answer 1

sudo apt install libip4tc2=1.8.5-2 libxtables12=1.8.5-2

seems to have done the trick. Thanks to Bravo for the tip in comments to the question.

  • seems odd that I have docker installed with version 1.8.7-1 of those packages ... perhaps the dependency problem has nothing to do with docker
    – Bravo
    Jan 18, 2022 at 1:36
  • what version of iptables do you have? (apt-cache show iptables)
    – Bravo
    Jan 18, 2022 at 1:39

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.