Bug 1086 - "dpkg --list" shows "/var/lib/dpkg/status: No such file or directory"
Summary: "dpkg --list" shows "/var/lib/dpkg/status: No such file or directory"
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.1
Assignee: Dexuan Cui
QA Contact:
URL:
Whiteboard: The patch is already in poky master(S...
Depends on: 1070
Blocks:
  Show dependency tree
 
Reported: 2011-05-18 18:31 UTC by Dexuan Cui
Modified: 2011-09-21 22:45 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dexuan Cui 2011-05-18 18:31:00 UTC
In target,  "dpkg --list" shows "dpkg-query: failed to open package info file `/var/lib/dpkg/status' for reading: No such file or directory"

Actually the files(status and available) does exist, but not in /var/lib/dpkg/ -- they're in /var/dpkg/. "ln -s /var/dpkg/{status, available} /var/lib/dpkg" can resolve the issue.

grepping '/var/dpkg' shows there are many files(package_deb.bbclass, rootfs_deb.bbclass, populate_sdk_deb.bbclas, apt.conf,... ) in which '/var/dpkg' is used and /var/lib/dpkg is not used at all.

However, looks dpkg's default admindir is /var/lib/dpkg -- e.g., Ubuntu uses this.


Pasted Mark's reply in oe-core mailing list:
------------------------------------------------
I would say that /var/lib/dpkg is the "correct" directory to use.  This matches
the behavior on other deb bases systems.  (It also mimics other pkg managers who
place their data into /var/lib/...)

--Mark
------------------------------------------------

So looks we should fix the recipes which use /var/dpkg/.
Comment 1 Dexuan Cui 2011-05-24 00:20:44 UTC
Porting the commits of OE should fix this bug:

ommit 41e0fbf792037f249d1b8d283b3de81718887c9f
Author: Filip Zyzniewski <filip.zyzniewski@gmail.com>
Date:   Sun Feb 13 03:26:58 2011 +0000

    deb packages support: switch from /var/dpkg to /var/lib/dpkg

    OE generally tries to use /var/dpkg, but the change is missing
    in some places, so it is needed to move completely to one of the
    options. Keeping the dpkg's default /var/lib/dpkg causes less
    maintenance overhead for OE.

    Signed-off-by: Filip Zyzniewski <filip.zyzniewski@gmail.com>
    Signed-off-by: Tom Rini <tom_rini@mentor.com>


commit 3b801ad400951fbc722587a7cf83d40a957e5022
Author: Filip Zyzniewski <filip.zyzniewski@gmail.com>
Date:   Mon Feb 7 02:00:35 2011 +0000

    dpkg-native: Fix the admindir location.

    Until now the admindir was specified as $STAGING_DIR_NATIVE/var/dpkg,
    which caused update-alternatives to put alternative definitions there.
    This patch causes the definitions to be put into the host's rootfs
    during rootfs_deb_do_rootfs (when running busybox postinst for
    example).

    resulting line in Dpkg.pm: our $admindir="$ENV{D}/var/dpkg"

    Signed-off-by: Filip Zyzniewski <filip.zyzniewski@gmail.com>
    Signed-off-by: Tom Rini <tom_rini@mentor.com>


ps, this commit is not related to this bug, but we should also port it to poky since I believe poky does have the same isse by my test:

commit 1659da8e9279a6e2293a69c69ee26f27f694b089
Author: Filip Zyzniewski <filip.zyzniewski@gmail.com>
Date:   Sun Feb 20 18:27:00 2011 +0000

    package_deb.bbclass/apt: armel architecture name for eabi systems.

    For dpkg EABI system architecture is called armel, not arm.
    Reference: http://wiki.debian.org/ArmEabiPort

    Signed-off-by: Filip Zyzniewski <filip.zyzniewski@gmail.com>
    Signed-off-by: Tom Rini <tom_rini@mentor.com>
Comment 2 Dexuan Cui 2011-06-02 16:41:54 UTC
I've backported the patches and testing.