7

I accidentally deleted the apt.conf.d folder and can’t install (use the apt-get) anything.

When I try to locate the apt.conf.d in the apt folder, it’s no longer there, 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.

It’s not in the trash because I used root access via terminal (so it’s 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? (What is the default content of the preferences.d and apt.conf.d?)

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

2 Answers 2

6

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.

2
  • @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, 2013 at 9:18
  • @Noob btw I have no preferences.d here on my server...
    – Rinzwind
    May 7, 2013 at 9:20
-1
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/";

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .