apt - 为什么 BitBake 生成的操作系统上缺少/var/lib/dpkg/status?

标签 apt yocto dpkg bitbake openembedded

我已经安装了apt通过添加 apt 到 BitBake 构建的系统上包到IMAGE_INSTALL我的食谱中有变量。

apt-getapt-cache现在在构建的系统上执行,但是如果我尝试对它们执行任何有用的操作(例如 apt-get updateapt-cache search ),我会收到以下错误:

E: Could not open file /var/lib/dpkg/status - open (2: No such file or directory)
E: The package lists or status file could not be parsed or opened

经过一些初步搜索,我在 Yocto 项目邮件列表中找到了这个交换:

Hi,

I have some requirement with apt-get in yocto genearted rootfs.

I built the yocto source code with enabling the apt package.

But after booting the image on my machine and run the "apt-get" command for installing some package it gives the following error.

Could not open the file /var/lib/dpkg/status open(2: no such a file or directory).

The package lists or status files could not be parsed or opened.

这个错误是因为需要添加package-managementEXTRA_IMAGE_FEATURESlocal.conf ,

PACKAGE_CLASSES ?= "package_deb"
EXTRA_IMAGE_FEATURES = "debug-tweaks package-management"

我已添加package-management但没有看到任何不同的输出。

touch /var/lib/dpkg/status之后, apt-get update返回以下内容:

Reading package lists...Done

我怎样才能得到apt通过使用 BitBake 元数据进入正常运行状态?

最佳答案

我发现了类似的thread来自恩智浦网站。

您需要设置自己的 Web 服务器并提供所有这些包并将服务器 URL 添加到源列表中。 SourceList

此外,您必须通过运行 bitbake package-index 来更新软件包 list ,并将 PACKAGE_CLASSES ?= "package_deb" 添加到 conf/local.conf

我之前已经成功设置过 OPKG。步骤类似,可以找here

关于apt - 为什么 BitBake 生成的操作系统上缺少/var/lib/dpkg/status?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35510734/

相关文章:

java - AOP 或 APT 用于覆盖父类(super class)的方法

Docker 构建退出,退出代码为 : 1

python - yocto/bitbake 配方中 '__anonymous' 函数的含义是什么?

python-3.x - 自定义 Python 脚本和 PyTest 的 Yocto Bitbake 配方

将某些方面升级到 3.x 后 Python 坏了

ubuntu - apt-get 通过隧道代理安装,但只能从客户端使用 ssh

c++ - 如何在 yocto 上移植 grpc helloworld(CPP) 示例

mysql - 我想在ubuntu18.10上安装mysql8.0,但是apt一直尝试安装mysql5.7,为什么?

ubuntu - 将安装脚本从 Redhat 更改为 Ubuntu

ubuntu - 在 Ubuntu 中删除损坏的包