How to install apt-get to the Yocto Project image
This post brings the step-by-step on how to configure an Yocto Project image to get apt-get
installed in your development machine.
After the step-by-step, there is a section to explain the commands, and then why this tutorial is not recommended for production (only development).
The step-by-step
Change the
build/conf/local.conf
by adding the following linesChoose an image, for example,
core-image-minimal
When itβs ready, create the package index:
Export the package index to the world
Deploy the image to the target
Boot your target and update it
At this point, only packages listed by
core-image-minimal
are available on the package index, so we need to build something different. For example, GStreamer. (donβt forget to update the package index as well)Update the target and install the package (donβt forget to be connected)
Understanding
The variable PACKAGE_CLASSES
1 defines the which package manager used to build the packages (among RPM, DEB, and IPK). It is common to hear people talking about apt-get
as a synonym of package management, but there are other programs and package managers (such as smart, dnf, opkg).
The default for Poky distro is RPM. Choosing the package manager for your application is out of this post scope, as itβs a complex decision. There are several articles debating this topic on the Internet.
Itβs one of the BitBakeβs tasks to create the packages to be installed in the images, so any BitBake command generates the packages under the directory build/tmp/deploy/<rpm>
in the RPM example.
BitBake can also create the package index, a complete list of all the packages inside that directory and available to be installed. When the target has the right packages installed and is configured to search for the package index in the right IP:PORT
, the developer can take advance of those already built packages to ease the development cycle.
In case, for any reason, the local machine IP changes after the image is deployed, change the file /etc/apt/sources.list
from the target rootfs with the new IP address.
Why this is a development only approach?
During the development cycle we are more interested in getting the package installed without the hassle of building and copying another image file. There is no real worry about how long the package will be available or to who.
However, during the production there are a lot of other important questions to think about, for example:
is the HTTP server secure?
is the package dependency chain fulfilled properly?
is the package dependency chain of all the package version fulfilled?
in case one package is updated, all the dependency chain must be updated?
During the development phase, we think more about installing missing packages, however during the production phase the most important point is to properly update the packages.
Last updated