[Bug 346386] Re: [MASTER] Update fails with invalid package files with "Encountered a section with no Package: header"

Jeff Hill johill at lanl.gov
Tue Sep 20 13:32:22 UTC 2011


I seem to be experiencing this issue also but "sudo rm -rf /var/lib/apt/lists" doesn't seem to help (I think maybe it did during the first install but my memory of the magic spells the first time isn't that good at this point). We do have a firewall here that returns configuration instructions for the proxy script. This may go south even during the install because I configured the script as soon as the system came up and have spent the rest of the day trying to get around this issue with apt-get. This is Ubuntu 11.04 (a 2nd install due catastrophic hard drive failure last weekend).


hill at Taz:~$ ls /var/lib/apt/lists/lock
/var/lib/apt/lists/lock
hill at Taz:~$ sudo apt-get update
Ign http://us.archive.ubuntu.com natty InRelease
Ign http://us.archive.ubuntu.com natty-updates InRelease
Ign http://extras.ubuntu.com natty InRelease   
Ign http://security.ubuntu.com natty-security InRelease
Ign http://us.archive.ubuntu.com natty Release.gpg
Ign http://extras.ubuntu.com natty Release.gpg 
..

sudo rm -rf /var/lib/apt/lists

hill at Taz:~$ sudo apt-get update
Ign http://us.archive.ubuntu.com natty InRelease
Ign http://security.ubuntu.com natty-security InRelease    
Ign http://us.archive.ubuntu.com natty-updates InRelease   
Ign http://security.ubuntu.com natty-security Release.gpg
Ign http://us.archive.ubuntu.com natty Release.gpg         
Ign http://security.ubuntu.com natty-security Release      
...

hill at Taz:~$ sudo fuser -vvv /var/lib/dpkg/lock
hill at Taz:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.04
DISTRIB_CODENAME=natty
DISTRIB_DESCRIPTION="Ubuntu 11.04"
hill at Taz:~$ uname -a
Linux dingy 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 athlon i386 GNU/Linux
hill at Taz:~$ sudo rm /var/lib/apt/lists/lock 
hill at Taz:~$ sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
hill at Taz:~$ sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
hill at Taz:~$ sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
hill at Taz:~$ sudo rm -rf /var/lib/dpkg/updates/*
hill at Taz:~$ sudo rm -rf /var/lib/apt/lists
hill at Taz:~$ sudo rm /var/cache/apt/*.bin
hill at Taz:~$ sudo mkdir /var/lib/apt/lists
hill at Taz:~$ sudo mkdir /var/lib/apt/lists/partial
hill at Taz:~$ LANG=C;sudo apt-get clean
[sudo] password for hill: 
hill at Taz:~$ LANG=C;sudo apt-get autoclean
Reading package lists... Done
Building dependency tree       
Reading state information... Done
hill at Taz:~$ LANG=C;sudo apt-get --purge autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
hill at Taz:~$ LANG=C;sudo apt-get update -o APT::Cache-Limit=25165824
Ign http://security.ubuntu.com natty-security InRelease
Ign http://us.archive.ubuntu.com natty InRelease           
Ign http://us.archive.ubuntu.com natty-updates InRelease   
...

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apt in Ubuntu.
https://bugs.launchpad.net/bugs/346386

Title:
  [MASTER] Update fails with invalid package files with "Encountered a
  section with no Package: header"

Status in “apt” package in Ubuntu:
  Fix Released
Status in “apt” source package in Natty:
  Fix Released
Status in “apt” package in Debian:
  Fix Released

Bug description:
  Binary package hint: adept-updater

  Pertinent data printed when attempting to run Updater as follows:

  An unresolvable problem occurred while initializing the package
  information.

  Please report this bug against the 'update-manager' package and
  include the following error message:

  'E:Encountered a section with no Package: header, E:Problem with
  MergeList /var/lib/apt/lists/us.archive.ubuntu
  .com_ubuntu_dists_intrepid_universe_binary-amd64_Packages, E:The
  package lists or status file could not be parsed or opened.'

  WORKAROUND:
  Remove problematic files from /var/lib/apt/lists/ and rerun apt-get update.

  In the event that one is connected to a network with a proxy server
  that returns html pages (like a web page requesting you to login) and
  not package list files.   Those html files will get downloaded to
  /var/lib/apt/lists/ and prevent someone from using a package manager
  until the problem html pages are removed.

  TEST CASE:
  1) Ensure /etc/apt/sources.list points to archive.ubuntu.com
  2) Setup proxy server to block access to archive.ubuntu.com and return something like http://people.canonical.com/~brian/tmp/not-packages.html
  3) Execute 'sudo apt-get update' in a terminal
  4) Observe the following:
  'E: Encountered a section with no Package: header
   E: Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_natty_main_binary-amd64_Packages
   E: The package lists or status file could not be parsed or opened.'
  5) Try 'apt-cache policy apt' and be sad that it doesn't work
  6) run 'sudo rm /var/lib/apt/lists/*Packages' to clear the error.

  With the proposed package installed repeat steps 1 to 3.
  4) Observe the following:
  ''Get:1 http://archive.ubuntu.com oneiric InRelease [189 B]
  Ign http://archive.ubuntu.com oneiric InRelease
  E: GPG error: http://archive.ubuntu.com oneiric InRelease: The following signatures were invalid: NODATA 1 NODATA 2'
  5) Try 'apt-cache policy apt' and be happy that it works

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/346386/+subscriptions




More information about the foundations-bugs mailing list