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 was receiving an error earlier from a fresh install of the Ubuntu server. Normally I grab either ubuntu server or the mini install and go from there myself.

This time when I started trying to use packages using apt-get install or apt-get update I would get an error:

Reading package list... Error!
E: Read error - read ( 21: Is a directory )
E: The package lists or status file could not be parsed or opened.

I wasn't entirely sure what this meant so I searched around google and came up with a number of different solutions, some involving synaptic while others involved dpkg. I even started removing all of the 'unstable' repositories from /etc/sources/list.d leaving only a few behind.

Either way I got hasty and mad and deleted the /var/lib/dpkg/ contents and I didn't make a backup. (I'm running it on a virtual machine so it's not a big deal I could just reinstall but I'd rather understand the actual problem).

In the case that I completely screwed up dpkg and deleted essential files, is there any easy way to repair this?

share|improve this question

marked as duplicate by Braiam, Eric Carvalho, Warren Hill, Alaa Ali, qbi Sep 24 '13 at 21:39

This question was marked as an exact duplicate of an existing question.… I found this post, I'll try this first and see how it goes. – Bryan Abrams Sep 19 '13 at 8:16
Did you check this answer ? – Braiam Sep 23 '13 at 13:36