Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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 deleted both the resolvconf folder and the resolv.conf file in /etc by mistake, assuming that resolvconf was causing UCK to fail. Now the application has upgraded, fixing the issue, but it says no file named resolv.conf in /etc. What it says is correct because I deleted those files. Is there any way to recreate the files or restore from another location?

share|improve this question
up vote 6 down vote accepted

You could reinstall resolvconf to restore the default configuration:
sudo apt-get install --reinstall resolvconf

Another idea would be remove "resolvconf" and then install:

sudo apt-get remove --purge resolvconf && sudo apt-get install resolvconf

share|improve this answer
Thanks.I will try. – beeju May 9 '12 at 0:39
Amplification: to ensure that resolvconf is fully restored you have to purge it and install it again, then reboot. If you don't purge it but only remove it then it won't install the symlink at /etc/resolv.conf on reinstall. If you don't reboot then resolvconf's database will generally be missing nameserver information until you do reboot... or reconfigure (down and up) all active interfaces. – jdthood Oct 28 '12 at 20:19
This broke my internet, and now I can't fetch any packages from the ubuntu repos. – thouliha Mar 30 at 16:54

If resolvconf -u shows the WARNING that /etc/resolv.conf is not a symbolic link to /run/resolvconf/resolv.conf then just backup of resolv.conf and make the symbolic link:

$ cd /etc
$ sudo ln -s /run/resolvconf/resolv.conf
share|improve this answer
This should be the accepted answer! How would you reinstall resolvconf when you can't resolve hostnames?! – Evils Apr 5 at 14:00

Have you emptied your trash, if not, you can restore from trash.

share|improve this answer
Thanks for reply.I never used delete alone but shift+delete,so not in trash. – beeju May 9 '12 at 0:41
+1 it is actually a good answer. – desgua May 9 '12 at 0:43
I see. Try to use a recovery program, i.e foremost. Or try to do what @desgua said. – Svetlana Belkin May 9 '12 at 0:43
And thanks @desgua. – Svetlana Belkin May 9 '12 at 0:44

I'm going to say that @desgua is likely on the right track. Ubuntu 12.04 uses a dynamically generated resolv.conf file and the files inside the resolvconf folder are part of the scripting for it...they are not ALL of the daemon but they are an important part of it, without which you will get no joy.

share|improve this answer

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.