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 accidentally deleted the apt.conf.d folder and cant install (use the apt-get) anything =( .

When I try to locate the apt.conf.d in the apt folder , its no longer there . EDIT: When I open the apt folder only sources.list can be found ... :( So that means that the apt.conf.d is not the only thing missing in the folder//

The main question is: How can I recreate/restore/retrieve the whole apt folder?

Additional :

While using apt-get in the terminal , I always get the error

W: Unable to read /etc/apt/apt.conf.d/ - DirectoryExists (2: No such file or directory)"

W: Unable to read /etc/apt/preferences.d/ - DirectoryExists (2: No such file or directory)

I'm using Ubuntu 12.04

Its not in the trash because i used root acces via terminal (so its deleted permanently , unfortunately )

EDIT the apt.conf.d folder has been recreated .. but how about the preferences.d ? what type of file should I recreate?

( by the way , what is the defaultcontent of the preferences.d and apt.conf.d )

Please help ! all answers would be appreciated fully /:

share|improve this question
Is that still exists in trash folder? or deleted permanently? – Aryo Adhi May 7 '13 at 6:09
can't you just create the folder using sudo mkdir /etc/apt/apt.conf.d ? – Nanne May 7 '13 at 7:17
@nanne probably correct. Found a source stating the same ;) – Rinzwind May 7 '13 at 7:47

According to bug 578446 on debian this also happens when you change distribution from command line using chdist. And it also states that recreating the directory should be enough.

share|improve this answer
@Noob no problem. Don't forget to accept and upvote if no other person has a better answer (and if you feel like it ;) ) – Rinzwind May 7 '13 at 9:18
@Noob btw I have no preferences.d here on my server... – Rinzwind May 7 '13 at 9:20
touch apt.conf

and then

sudo vi apt.conf

Next add the proxy,

edit the file and make sure in the below format:

Acquire::http::proxy "proxy:port-number/";
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.