How do I completely remove and reinstall Samba on Debian?

68,367

Solution 1

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).

Solution 2

On Ubuntu (17) I did

apt purge samba samba-common

followed by

apt install system-config-samba

which worked for me.

Share:
68,367

Related videos on Youtube

Jane Panda
Author by

Jane Panda

Updated on September 17, 2022

Comments

  • Jane Panda
    Jane Panda almost 2 years

    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?

  • Jane Panda
    Jane Panda almost 14 years
    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.
  • Pylsa
    Pylsa almost 14 years
    @Bob you may need a reboot
  • Jane Panda
    Jane Panda almost 14 years
    Awesome, that did the trick! I guess sometimes rebooting -does- work on *nixy stuff. Thanks!
  • Pylsa
    Pylsa almost 14 years
    @Bob Great it worked for you! Good luck with your fresh samba install! Haha! ;)
  • Antônio Medeiros
    Antônio Medeiros almost 7 years
    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.
  • Sanjok Gurung
    Sanjok Gurung over 5 years
    This worked for me in Ubuntu 14.04