Public bug reported:

$ 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)
     Importance: Undecided
         Status: New

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

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

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to