Debian / Ubuntu Linux: E: Encountered a section with no Package: header Error and Solution

Posted on in Categories last updated April 5, 2012

I‘m running the apt-get update command to fetch updates but getting the following errors:

Get:1 http://security.debian.org squeeze/updates Release.gpg [836 B]
Ign http://security.debian.org/ squeeze/updates/contrib Translation-en
Ign http://security.debian.org/ squeeze/updates/contrib Translation-en_IN
Ign http://security.debian.org/ squeeze/updates/main Translation-en
Ign http://security.debian.org/ squeeze/updates/main Translation-en_IN
Ign http://security.debian.org/ squeeze/updates/non-free Translation-en
Ign http://security.debian.org/ squeeze/updates/non-free Translation-en_IN
Get:2 http://security.debian.org squeeze/updates Release [86.9 kB]
Get:3 http://security.debian.org squeeze/updates/main Sources [89.5 kB]
Get:4 http://security.debian.org squeeze/updates/contrib Sources [765 B]
Get:5 http://security.debian.org squeeze/updates/non-free Sources [20 B]
Get:6 http://security.debian.org squeeze/updates/main amd64 Packages [273 kB]
Get:7 http://security.debian.org squeeze/updates/contrib amd64 Packages [620 B]
Get:8 http://security.debian.org squeeze/updates/non-free amd64 Packages [20 B]
Hit http://mirror.anl.gov squeeze Release.gpg
Ign http://mirror.anl.gov/debian/ squeeze/contrib Translation-en
Ign http://mirror.anl.gov/debian/ squeeze/contrib Translation-en_IN
Ign http://mirror.anl.gov/debian/ squeeze/main Translation-en
Ign http://mirror.anl.gov/debian/ squeeze/main Translation-en_IN
Ign http://mirror.anl.gov/debian/ squeeze/non-free Translation-en
Ign http://mirror.anl.gov/debian/ squeeze/non-free Translation-en_IN
Hit http://mirror.anl.gov squeeze Release
Hit http://mirror.anl.gov squeeze/main Sources
Hit http://mirror.anl.gov squeeze/non-free Sources
Hit http://mirror.anl.gov squeeze/contrib Sources
Hit http://mirror.anl.gov squeeze/main amd64 Packages
Hit http://mirror.anl.gov squeeze/non-free amd64 Packages
Hit http://mirror.anl.gov squeeze/contrib amd64 Packages
Fetched 451 kB in 12s (36.5 kB/s)
Reading package lists… Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/security.debian.org_dists_squeeze_updates_contrib_i18n_Translation-en
E: The package lists or status file could not be parsed or opened.

How do I fix this problem under Debian or Ubuntu Linux operating systems?

To solve this problem login as root user and type the following commands:
# rm -rf /var/lib/apt/lists/*
# apt-get update

Sample outputs:

Get:1 http://security.debian.org squeeze/updates Release.gpg [836 B]                               
Ign http://security.debian.org/ squeeze/updates/contrib Translation-en                             
Ign http://security.debian.org/ squeeze/updates/contrib Translation-en_IN
Get:2 http://mirror.anl.gov squeeze Release.gpg [1,672 B]
Ign http://mirror.anl.gov/debian/ squeeze/contrib Translation-en
Ign http://security.debian.org/ squeeze/updates/main Translation-en
Ign http://security.debian.org/ squeeze/updates/main Translation-en_IN
Ign http://security.debian.org/ squeeze/updates/non-free Translation-en
Ign http://security.debian.org/ squeeze/updates/non-free Translation-en_IN
Get:3 http://security.debian.org squeeze/updates Release [86.9 kB]
Ign http://mirror.anl.gov/debian/ squeeze/contrib Translation-en_IN
Ign http://mirror.anl.gov/debian/ squeeze/main Translation-en
Ign http://mirror.anl.gov/debian/ squeeze/main Translation-en_IN
Ign http://mirror.anl.gov/debian/ squeeze/non-free Translation-en
Ign http://mirror.anl.gov/debian/ squeeze/non-free Translation-en_IN
Get:4 http://mirror.anl.gov squeeze Release [107 kB]
Get:5 http://security.debian.org squeeze/updates/main Sources [89.5 kB]
Get:6 http://security.debian.org squeeze/updates/contrib Sources [765 B]
Get:7 http://security.debian.org squeeze/updates/non-free Sources [20 B]     
Get:8 http://security.debian.org squeeze/updates/main amd64 Packages [273 kB]         
Get:9 http://security.debian.org squeeze/updates/contrib amd64 Packages [620 B]
Get:10 http://security.debian.org squeeze/updates/non-free amd64 Packages [20 B]
Get:11 http://mirror.anl.gov squeeze/main Sources [5,767 kB]                
Get:12 http://mirror.anl.gov squeeze/non-free Sources [88.8 kB]                                    
Get:13 http://mirror.anl.gov squeeze/contrib Sources [48.2 kB]                                     
Get:14 http://mirror.anl.gov squeeze/main amd64 Packages [8,603 kB]                                
Get:15 http://mirror.anl.gov squeeze/non-free amd64 Packages [124 kB]                              
Get:16 http://mirror.anl.gov squeeze/contrib amd64 Packages [64.0 kB]                              
Fetched 15.3 MB in 43s (354 kB/s)                                                                  
Reading package lists... Done

Finally, apply new updates, enter:
# apt-get upgrade
Sample outputs:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be upgraded:
  curl libcurl3 libpng12-0 libtiff4
4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 893 kB of archives.
After this operation, 36.9 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://security.debian.org/ squeeze/updates/main libcurl3 amd64 7.21.0-2.1+squeeze2 [285 kB]
Get:2 http://security.debian.org/ squeeze/updates/main curl amd64 7.21.0-2.1+squeeze2 [229 kB]
Get:3 http://security.debian.org/ squeeze/updates/main libpng12-0 amd64 1.2.44-1+squeeze4 [180 kB]
Get:4 http://security.debian.org/ squeeze/updates/main libtiff4 amd64 3.9.4-5+squeeze4 [198 kB]    
Fetched 893 kB in 8s (110 kB/s)                                                                    
Reading changelogs... Done
(Reading database ... 29345 files and directories currently installed.)
Preparing to replace libcurl3 7.21.0-2.1+squeeze1 (using .../libcurl3_7.21.0-2.1+squeeze2_amd64.deb) ...
Unpacking replacement libcurl3 ...
Preparing to replace curl 7.21.0-2.1+squeeze1 (using .../curl_7.21.0-2.1+squeeze2_amd64.deb) ...
Unpacking replacement curl ...
Preparing to replace libpng12-0 1.2.44-1+squeeze3 (using .../libpng12-0_1.2.44-1+squeeze4_amd64.deb) ...
Unpacking replacement libpng12-0 ...
Preparing to replace libtiff4 3.9.4-5+squeeze3 (using .../libtiff4_3.9.4-5+squeeze4_amd64.deb) ...
Unpacking replacement libtiff4 ...
Processing triggers for man-db ...
Setting up libcurl3 (7.21.0-2.1+squeeze2) ...
Setting up curl (7.21.0-2.1+squeeze2) ...
Setting up libpng12-0 (1.2.44-1+squeeze4) ...
Setting up libtiff4 (3.9.4-5+squeeze4) ...

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

14 comment

  1. E: Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit. Current value: 25165824. (man 5 apt.conf)
    E: Error occurred while processing pike7.6-svg (NewFileDesc2)
    E: Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_universe_binary-i386_Packages
    E: The package lists or status file could not be parsed or opened.
    E: _cache->open() failed, please report.

Leave a Comment