I had a similar error on Ubuntu 20.04 and this was the way to solve it:
Remove all samba related files and configuration files
sudo apt purge python3-samba samba-common samba-common-bin samba-dsdb-modules samba samba-vfs-modules smbclient
Optionally you can remove the packages and maintain the configuration files, but this could left wrong files in the middle. It's better to do a backup of your configuration files. Anyway, if you want to try it, use remove
instead of purge
.
Reboot
Not sure if it's completely necessary, but I do it this way.
Share files
Open Nautilus and share a file or directory. A warning is showed indicating the sharing service is not installed and allowing you to click to install it. Click, install and you're done!
The nautilus-share package creates the /var/lib/samba/usershares/
directory with the right permissions and added your user to sambashare
group, and it's ready to be used by other users too.