11

My Samba installation has become a mess, and now the services won't even start correctly anymore, for some reason.

Is there a way to completely remove Samba, as if it was never there, and then reinstall it so I can have a fresh setup?

HopelessN00b
  • 1,882
  • 3
  • 21
  • 29
Jane Panda
  • 1,188
  • 4
  • 13
  • 28

2 Answers2

10
sudo apt-get purge samba

will remove the entire package, along with configuration files, which apt-get remove samba won't. After the purge, reinstall samba using

sudo apt-get install samba

from man apt-get:

purge
    purge is identical to remove except that packages are removed and
    purged (any configuration files are deleted too).
Pylsa
  • 30,630
  • 16
  • 89
  • 116
  • Well it looks like that sort of worked, but now it seems to have hung on "Starting Samba daemons: nmbd smbd". I didn't see any errors before that, but to be fair it went by fairly quick, heh. – Jane Panda Aug 28 '10 at 21:58
  • 1
    @Bob you may need a reboot – Pylsa Aug 28 '10 at 22:00
  • Awesome, that did the trick! I guess sometimes rebooting -does- work on *nixy stuff. Thanks! – Jane Panda Aug 28 '10 at 22:17
  • 1
    @Bob Great it worked for you! Good luck with your fresh samba install! Haha! ;) – Pylsa Aug 28 '10 at 22:24
4

On Ubuntu (17) I did

apt purge samba samba-common

followed by

apt install system-config-samba

which worked for me.

loop
  • 151
  • 2
  • 2
    Debian 9.0 does not have a package called `system-config-samba`. But the hint of the package `samba-common` saved my day! So what I did was (as root) `apt purge samba samba-common`, `apt --purge autoremove` and finally `apt-get install samba`. – Antônio Medeiros Aug 10 '17 at 17:18
  • This worked for me in Ubuntu 14.04 – Sanjok Gurung Jan 28 '19 at 10:17