What has changed lately with the Docker installation on Raspbian that makes Docker installation fail and what can be done about it?

On Raspberry Pi 3, installation of docker from get.docker.com fails with error message:

Error! The dkms.conf for this module includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch. This indicates that it should not be built.

I tried editing /usr/src/aufs-4.9+20161219/dkms.conf and removing the line


then running

sudo apt-get remove -y docker-engine
sudo apt-get install -y docker-engine

which seems to fix the problem as far as I can see but it does seems to be a hack to just remove the check of the kernel version.

pi@kubmaster:~ $ uname -a
Linux kubmaster 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l GNU/Linux

Steps to reproduce:

  1. Download Raspbian Stretch Lite from https://www.raspberrypi.org/downloads/raspbian/ with release date 2017-09-07, write image to an SD card, start Rasbian and setup networking.
  2. Run the following commands:

    sudo apt-get update && sudo apt-get -y upgrade
    curl -fsSL get.docker.com -o get-docker.sh
    chmod +x get-docker.sh
    sudo ./get-docker.sh

1 Answer 1


I had similar error. Try to install kernel headers:

sudo aptitude install linux-headers-4.9.0-4-all raspberrypi-kernel-headers
  • That worked nicely, both on Raspbian Stretch and Jessie! I had tried installing the raspberrypi-kernel-headers but not the linux-headers-4.9.0-4-all. Thank you @Idanko!
    – smuda
    Oct 21, 2017 at 13:07
  • @JohnAllberg if my solution works, please accept it (click the acceptance mark on the left)
    – ldanko
    Oct 24, 2017 at 11:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .