I've been trying to install Samba on my Raspberry Pi, but seem to have created a broader issue in the process.

The steps to the issue were the following:

  • I ran the install code: sudo apt-get install samba samba-common-bin

  • The install got stuck after a while, on the following message:

Setting up samba (2:4.9.5+dfsg-5+deb10u1+rpi1) ... Samba is not being run as an AD Domain Controller: Masking samba-ad-dc.service Please ignore the following error about deb-systemd-helper not finding those services. (samba-ad-dc.service already masked)

  • Now, I can't install anthing, nor remove the partial samba install. Any attempt ends in

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

  • Running the suggested command leads me back to the samba error message above.

  • I have tried all I could find online. Those had no effect: sudo apt-get -f install sudo apt-get clean Nor did killing the four processes running that refer to smbd.

  • The only thing that seemed to change something was sudo dpkg --clear-selections

  • However, as soon as I launch any install after that, such as sudo apt-get upgrade I end up back in the same loop.

  • I also tried removing samba with sudo apt-get remove --purge samba, but it went back to the same loop too.

I can live with not installing samba, but not being able to install anything is more of a problem. Anyone who could help me solve the issue? Thanks!

  • 1
    The likely quickest solution is to write a fresh image to the SD card (after making a copy of anything you need).
    – joan
    Jul 21, 2020 at 20:04
  • "the samba error message above" - it's not an error, it even says Please ignore the following error Jul 22, 2020 at 1:36

1 Answer 1


After continuing to search on the issue, I think I have solved it. I ran the following:

  • sudo apt-get autoclean
  • dpkg –-remove samba
  • dpkg –-purge samba
  • apt-get clean && apt-get autoremove (not 100% certain about the order)

Then, I ran again

  • sudo dpkg --configure -a
  • sudo apt-get upgrade.

For some reason, the issue seems resolved.

Thank you all for your help!

EDIT: Further to this, I have resolved the underlying issue that prevented me from installing samba:

  • After removing everything, I tried to install it again, but got stuck at the same step as my first message. The RPi shutdown again and I was faced with the same error message and error/crash loop.
  • I ran dmesg and somewhere there was a message saying Under-voltage detected! (0x00050005)
  • I had not thought of this, because I was running an older RPi on the same power supply, but this one seems to need more amperage.
  • I switched the power supply (the phone charger in this case) to a more recent one, with Quick Charge, and ran sudo dpkg --configure -a. Samba install completed.

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.