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

After making index for my local repository, I get this error while updating.

E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/_home_soroush_repository_dists_precise_local_binary-amd64_Packages
E: The package lists or status file could not be parsed or opened.
E: _cache->open() failed, please report.

Then no package manager works. I know that there is a problem with index file generated by dpkg-scan-packages but can't find it.

I maintain my repo using this script and it worked properly for a long time:

for dist in "precise" #"oneiric"
    for component in "local"
        for architecture in "amd64" # "i386" "all" 
            echo "Generating package index for $dist $component $architecture..." 
            dpkg-scanpackages -a $architecture pool/local /dev/null | gzip -9c > dists/$dist/local/binary-$architecture/Packages
    echo "Generating source index for $dist $component $architecture..." 
    dpkg-scansources pool/local > dists/$dist/local/sources/Sources

My question is how can I find which package is causing problem in index file? There should be some sort of parser for that...

share|improve this question
Similar question for those that are seeing the same sort of error but not using a local repository:… – fossfreedom Dec 10 '13 at 23:48

So, this is a little weird I'm answering my own question! :D

This may help someone out there. I found that the only problem is file name of generated index. It should end up with .gz extension. Previously Packages was acceptable for dpkg now he expects Packages.gz. This is a new rule, meanwhile, someone in debian team decided it to be like this! I updated my local repo generator script and everything works file now.

share|improve this answer
how did you update? – Mild Fuzz Jun 8 '13 at 19:25
@MildFuzz dpkg-scanpackages -a $architecture pool/local | gzip -9c > dists/$dist/local/binary-$architecture/Packages.gz – sorush-r Jun 10 '13 at 9:18

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.