apt_pkg: E:The package lists or status file could not be parsed or opened.

Bug #992311 reported by cleary
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
New
Undecided
Unassigned

Bug Description

$ apt-cache policy python3-apt
python3-apt:
  Installed: 0.8.3ubuntu7
  Candidate: 0.8.3ubuntu7
  Version table:
 *** 0.8.3ubuntu7 0
        500 http://au.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04 LTS"

I get an error trying to grab a Cache object from a vanilla chroot.
This is probably related to a similar bug in python-apt:
https://bugs.launchpad.net/ubuntu/+source/python-apt/+bug/984523

Logged commands/errors:

$ sudo debootstrap precise /home/bgray/svn/pyfll-ubuntu/amd64.vanilla_debootstrap
$ python3
>>> import apt_pkg
>>> apt_pkg.init_config()
>>> apt_pkg.config.set('RootDir', ' /home/bgray/amd64.vanilla_debootstrap/')
>>> apt_pkg.config.set('APT::Architecture', 'amd64')
>>> apt_pkg.init_system()
>>> import pdb; pdb.set_trace()
--Return--
> <stdin>(1)<module>()->None
(Pdb) cache = apt_pkg.Cache(None)
*** SystemError: W:Unable to read /home/bgray/amd64.vanilla_debootstrap//etc/apt/sources.list.d/ - DirectoryExists (2: No such file or directory), W:Unable to read /home/bgray/amd64.vanilla_debootstrap//etc/apt/sources.list - RealFileExists (2: No such file or directory), E:Could not open file /home/bgray/amd64.vanilla_debootstrap//var/lib/dpkg/status - open (2: No such file or directory), E:The package lists or status file could not be parsed or opened.
(Pdb) c
>>> quit()

/home/bgray/amd64.vanilla_debootstrap//var/lib/dpkg/status exists, is readable and seems correctly formatted.

Due to both python-apt and python3-apt exhibiting the same issue, I'd anticipate it's an incompatibility with apt.

I've just about reached the end of my troubleshooting abilities though, but if there's anything else you want me to try, please ask.

affects: python-apt (Ubuntu) → apt (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.