How do I completely remove Samba?
How do I completely rip-out smb / samba from my Ubuntu 11.10 machine?
How do I, afterwards, reinstall it cleanly?
UPDATE: My goal is to rip out any functionality related to Windows SMB from my desktop and do a clean re-install of these components. See this question for some background.
So, for the server, from the Terminal:
sudo apt-get remove --purge samba sudo apt-get install samba
But, if you are having client problems, it would be more like:
sudo apt-get remove --purge smbclient libsmbclient sudo apt-get install smbclient libsmbclient
Note that this answer only applies to Ubuntu 11.10! More recent Ubuntus will probably remove useful software with the
apt removecommand, so be sure to check what is being removed and if needed "cherrypick" packages in
After I have completed both "server" and "client" components, how come Nautilus still shows "Browse Network" and "Windows Network" then?
Is there a relationship with Gnome/GVFS somewhere along the lines? How do I get rid / re-install that too?
Even after your proposed steps, I still can do "mount -t cifs". How do I completely get rid of smb stuff and do a clean install?
The reason that you can still mount a cifs filesystem even after removing samba is that the cifs kernel module is not a part of any samba package. It is included in the kernel. That module has client support only for accessing cifs shares on a network. One does not need samba to access shares. But to create them samba needs to be installed.
@jldupont, I'd recommend sticking with the original question. I'll go over there and answer.
`sudo apt-get remove --purge smbclient libsmbclient` command is removing useful softwares like `gvfs-backends* libsmbclient* python3-smbc* software-center* system-config-printer-common* system-config-printer-gnome* ubuntu-desktop* vlc-plugin-samba*` so vote down
A easier way to remove Samba that is simpler and cleaner.
sudo apt-get autoremove samba samba-common
This step uses the autoremove to remove the package.
sudo apt-get purge samba samba-common
This step cleans any configuration file you may have
These solutions all relay on the system booting. But what do you do if your system is not booting because of samba?
If you are stuck in recovery mode, IE the rescue disk. apt-get does not always work, in fact it will get you a seg fault in a recovery shell, atleast on Ubuntu from what I've seen. To get around that, you can use
dpkg --purge --force-all sambaand also for common and winbind if the system still wont boot.
Remember if you are in the recorvery mode shell, do not use sudo, because that will cause a seg fault. Just use the commands as you would if you were in as root.
But I have had Samba cause a system to stop booting, and this is how I was able to rip samba out, and then do a clean install after I got the system booting all the way up again. Once it's booted all the way up, go through and do the
sudo apt-get remove --purge samba samba-commoncommand to make sure everything has been removed. Unfortunately, you may also have to manually delete some items, because dpkg does not always delete startup scripts and other items the binary creates. This is what I've had to do, to thoroughly remove samba, when I couldn't get the system to boot.
I hope this helps someone who was stuck in the same situation as me.
I recently installed Ubuntu 17.04 under VirtualBox on a Windows 7 host and I needed to access files on the host. I'm fairly new to Linux so I thought I needed samba to access those shares. As mentioned above by dpb, I was having client problems. It turned out all I really needed to do was remove samba. Having Ubuntu 17.04 meant I had to re-install
smbclientin order to get client functionality back:
sudo apt-get install cifs-utils
After reboot, all my Windows network shares were accessible and client issues resolved.