πŸ’»
Programming Concept
  • πŸ‘¨β€πŸ”¬About Me
  • πŸ“—C++ STL Concept 2023
    • πŸ“–STL in CPP ( Part I)
    • πŸ“–STL in CPP ( Part II)
    • πŸ“–STL in CPP ( Part III )
    • πŸ“–STL in CPP ( Part IV )
    • πŸ“–STL in CPP ( Part V )
    • πŸ“–STL in CPP ( Part VI )
    • πŸ“–STL in CPP ( Part VII )
  • ✏️Pointers in C / C++
    • πŸ“–Pointers in details
  • πŸ“˜Strings in CPP 2023
  • πŸ•žThread in C++ 2023
  • πŸ““Smart Pointer in C++ 2023
  • Basic C++ Topics
    • πŸ’ΌType Casting in C++ 2023
  • πŸ’»Advanced C++ Programming
    • πŸŽ“Topics (Syllabus)
    • πŸ§‘β€πŸŽ“Inheritance and Polymorphism
    • πŸ–ŠοΈException Handling
    • πŸƒRuntime Type Information
    • πŸ“”An Overview of Templates
    • πŸ“‘Template in C++
  • πŸ’»Embedded Linux
    • πŸ–₯️Embedded Linux OS
      • Build Yocto Project Step By Step
      • How to install apt-get to the Yocto Project image
      • Installing gcc/g++ toolchain in yocto project
      • Installing GDB in yocto project
      • Installing ssh-server-dropbear for embedded linux in yocto project
      • Add Python To A Build
      • Add Boost To A Build
      • Adding Valgrind To Build
      • How To Add A Custom App To A Yocto Build
      • Raspberry Pi
    • πŸ“ΆCommunication Protocols
      • ✏️Working With I2C using c++
      • πŸ“”SPI Implementation with source code in C++
      • πŸ““Linux Serial Ports Using C/C++
      • πŸ–±οΈUART
      • πŸ–¨οΈUniversal GPIO Access
  • πŸ§‘β€πŸ’»QT QML
    • πŸ“˜QT QML Concept 2023
      • Why Qt Framework and QML
      • Sqlite3 for qtquick application
      • How To Install sqlite3 in windows 11 || Windows 10
      • Signals and Slots in Qt QML
      • Working with Signals and Slots in QML
      • Sorting QML ListModels
      • ListView In QML With Section Delegate
      • Registration of custom enum in QML
      • Registering a QML Type as a Singleton object
      • Using enumerations in QML without C ++
      • Registering a Singleton object to use β€œStatic” methods in QML
      • Connecting JavaScript files to other JavaScript files in a Qt / QML project
      • Positioning in Qt QML with anchors
      • TextInput validators in Qt Qml
      • Qt Qml Abstract Item Model using C++
      • Qt QML List Model
      • How to Register your C++ Class as a QML Type
      • Jabra Speaker Connect Qt Project
      • Qt | One article summarizing QObject
  • ▢️QT Concept
    • ℹ️Icon button
    • πŸ’»Register QML Singletone in CP
Powered by GitBook
On this page
  • The step-by-step
  • Understanding
  • Why this is a development only approach?

Was this helpful?

  1. Embedded Linux
  2. Embedded Linux OS

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

  1. Change the build/conf/local.conf by adding the following lines

    PACKAGE_CLASSES = "package_deb"
    PACKAGE_FEED_URIS = "http://<local-machine-ip>:5678"
    EXTRA_IMAGE_FEATURES += " package-management "
  2. Choose an image, for example, core-image-minimal

    $ bitbake core-image-minimal
  3. When it’s ready, create the package index:

    $ bitbake package-index
  4. Export the package index to the world

    $ cd build/tmp/deploy/deb
    $ python -m SimpleHTTPServer 5678
  5. Deploy the image to the target

    $ sudo dd if=core-image-minimal.wic of=/dev/sdX
  6. Boot your target and update it

    $ apt-get update
  7. 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)

    $ bitbake gstreamer1.0
    $ bitbake package-index
  8. Update the target and install the package (don’t forget to be connected)

    $ apt-get update
    $ apt-cache search gstreamer1.0
    $ apt-get install gstreamer1.0

Understanding

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.

PreviousBuild Yocto Project Step By StepNextInstalling gcc/g++ toolchain in yocto project

Last updated 1 year ago

Was this helpful?

The variable PACKAGE_CLASSES 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).

πŸ’»
πŸ–₯️
1