Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I accidentally removed my /etc/samba folder from my installation of Ubuntu Server 12.04. Where can I get a new copy of the folder as it comes with a fresh installation?

share|improve this question
up vote 1 down vote accepted

You can ask dpkg about all packages that should have a file in this folder by

$ dpkg -S /etc/samba

then issuing

# apt-get install --reinstall package1 package2 ...

should reinstall these packages and hence restore the configuration files.

You might also want to have a look at etckeeper, a tool to keep /etc in a git repository (and hence easily recover from mistakes such as the above).

share|improve this answer
dpkg -S /etc/samba returns samba-common. After apt-get purge samba-common and apt-get install samba-common, I still get "not found" when trying to ls /etc/samba – Keyslinger Dec 5 '12 at 14:38
Ah, right, yes, sorry. Try the solution in , the config file handling is sometimes a little bit…strange :-) – Claudius Dec 5 '12 at 14:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.