Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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 serverfault.com/a/363418 , the config file handling is sometimes a little bit…strange :-) –  Claudius Dec 5 '12 at 14:42
add comment

Your Answer

 
discard

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.