DESK-MX6-L-AN-0003: Package Management with Yocto and DNF

From DAVE Developer's Wiki
Revision as of 07:47, 5 October 2021 by U0007 (talk | contribs) (Introduction)

Jump to: navigation, search
Info Box


200px-Emblem-important.svg.png

This application note has been validated using the kit version in the History table.

History[edit | edit source]

Version Date Development Kit version
1.0.1 Oct 2021 DESK-MX6UL-L 1.0.1

Introduction[edit | edit source]

Since some Yocto releases, DNF is the default package manager for installing packages in the DUT (target machine).

The Dandified Packaging Tool (DNF) performs runtime package management of RPM packages. In order to use DNF for runtime package management, you must perform an initial setup on the target machine for cases where the PACKAGE_FEED_* variables were not set as part of the image that is running on the target.

This application note details how to use DNF for installing packages with a Yocto based root file system

DNF[edit | edit source]

DNF is a software package manager that installs, updates, and removes packages on RPM-based Linux distributions. It automatically computes dependencies and determines the actions required to install packages. DNF also makes it easier to maintain groups of machines, eliminating the need to manually update each one using rpm. Introduced in Fedora 18, it has been the default package manager since Fedora 22.

More information can be found on Fedora's wiki DNF page

Configuring the DNF repository[edit | edit source]

It is possibile to add and configure DNF repositories using additional .repo files: it is recommended to define individual repositories in new or existing .repo files in the /etc/yum.repos.d/ directory.

More information in the Configuring DNF and DNF_Repositories Fedora's page.

Here below an example on how to create the .repo with the proper setting options

root@desk-mx6ul-axelulite:~# mkdir -p /etc/yum.repos.d 
root@desk-mx6ul-axelulite:~# 
{
  echo [cortexa7hf]
  echo name=desk-mx6ul-1.0.1
  echo enabled=1                                                    
  echo gpgcheck=0                                                  
  echo baseurl=http://yocto.dave.eu/desk-mx6ul-l-1.0.1/cortexa7hf_neon/
} | tee >> /etc/yum.repos.d/dave.repo
root@desk-mx6ul-axelulite:~#

Installing packages on target[edit | edit source]

We assume that network interface has been already configured for Internet access. In any case, a simple network configuration can be done directly on serial console with the following commands:

root@desk-mx6ul-axelulite:~# ifconfig eth0 192.168.0.94
root@desk-mx6ul-axelulite:~# route add default gw 192.168.0.254
root@desk-mx6ul-axelulite:~# echo "nameserver 8.8.8.8" > /etc/resolv.conf

Then, for installing a package, it is enough to invoke dnf with the install parameter, for example:

root@desk-mx6ul-axelulite:~# dnf install fb-test


References[edit | edit source]