|Upated info for [[DESK-MX6UL-L|DESK-MX6UL-L-3.0.0]] and [[DESK-MX6-L|DESK-MX6-L-3.0.0]]
|-
|}
==Introduction==
Since [https://www.yoctoproject.org/docs/2.3/dev-manual/dev-manual.html#using-runtime-package-management Pyro (2.3) Yocto release], DNF is the default package manager for installing packages in the DUT (target machine). The [https://en.wikipedia.org/wiki/DNF_(software) 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 [https://dnf.readthedocs.io/en/latest/index.html DNF ] for installing packages with a Yocto based root file system
== DNF ==
More information in the [https://docs.fedoraproject.org/en-US/fedora/f34/system-administrators-guide/package-management/DNF/#sec-Configuring_DNF_and_DNF_Repositories Configuring DNF and DNF_Repositories] Fedora's page.
Here below an example on how to create the <code>.repo</code> with the proper [https://docs.fedoraproject.org/en-US/fedora/f34/system-administrators-guide/package-management/DNF/#sec-Setting_repository_Options setting options]using DAVE's Yocto server and [[AXEL ULite SOM|AXEL ULite]] package repositories:
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 according to the following commands[[DESK-MX6UL-L/Deployment/How_to_configure_the_network_interfaces#Static_IP_address | How to configure the network interfaces]] wiki page:
<pre class="board-terminal">
root@desk-mx6ul-axelulite:~# ifconfig cat /etc/systemd/network/eth0 .network[Match]Name=eth0 # Prevent the interface loading if the kernel boots from nfsKernelCommandLine=!nfsroot [Network]Address=192.168.0.9490root@desk-mx6ul-axelulite:~# route add default gw Gateway=192.168.0.254DNS=192.168.0.1root@desk-mx6ul-axelulite:~# echo "nameserver 8.8.8.8" > /etc/resolv.conf
</pre>
Then, for installing a package, it is enough to invoke <code>dnf</code> with the ''install'' parameter, for example:
<pre class="board-terminal">root@desk-mx6ul-axelulite:~# dnf install lighttpdLast metadata expiration check: 0:06:50 ago on Wed Apr 13 09:02:51 2022.Dependencies resolved.======================================================================================================================================================================= Package Architecture Version Repository Size=======================================================================================================================================================================Installing: lighttpd cortexa7t2hf_neon 1.4.59-r0 cortexa7t2hf_neon 146 kInstalling dependencies: lighttpd-module-dirlisting cortexa7t2hf_neon 1.4.59-r0 cortexa7t2hf_neon 15 k lighttpd-module-indexfile cortexa7t2hf_neon 1.4.59-r0 cortexa7t2hf_neon 8.8 k lighttpd-module-staticfile cortexa7t2hf_neon 1.4.59-r0 cortexa7t2hf_neon 8.5 kInstalling weak dependencies: lighttpd-module-access cortexa7t2hf_neon 1.4.59-r0 cortexa7t2hf_neon 8.5 k lighttpd-module-accesslog cortexa7t2hf_neon 1.4.59-r0 cortexa7t2hf_neon 15 k Transaction Summary=======================================================================================================================================================================Install 6 Packages Total download size: 201 kInstalled size: 313 kIs this ok [y/N]: yDownloading Packages:(1/6): lighttpd-module-access-1.4.59-r0.cortexa7t2hf_neon.rpm 1.7 kB/s | 8.5 kB 00:05(2/6): lighttpd-module-accesslog-1.4.59-r0.cortexa7t2hf_neon.rpm 2.9 kB/s | 15 kB 00:05(3/6): lighttpd-module-indexfile-1.4.59-r0.cortexa7t2hf_neon.rpm 160 kB/s | 8.8 kB 00:00(4/6): lighttpd-module-dirlisting-1.4.59-r0.cortexa7t2hf_neon.rpm 168 kB/s | 15 kB 00:00(5/6): lighttpd-1.4.59-r0.cortexa7t2hf_neon.rpm 28 kB/s | 146 kB 00:05(6/6): lighttpd-module-staticfile-1.4.59-r0.cortexa7t2hf_neon.rpm 110 kB/s | 8.5 kB 00:00-----------------------------------------------------------------------------------------------------------------------------------------------------------------------Total 38 kB/s | 201 kB 00:05Running transaction checkTransaction check succeeded.Running transaction testTransaction test succeeded.Running transaction Preparing : 1/1 Installing : lighttpd-module-staticfile-1.4.59-r0.cortexa7t2hf_neon 1/6 Running scriptlet: lighttpd-module-staticfile-1.4.59-r0.cortexa7t2hf_neon 1/6......... Verifying : lighttpd-1.4.59-r0.cortexa7t2hf_neon 1/6 Verifying : lighttpd-module-access-1.4.59-r0.cortexa7t2hf_neon 2/6 Verifying : lighttpd-module-accesslog-1.4.59-r0.cortexa7t2hf_neon 3/6 Verifying : lighttpd-module-dirlisting-1.4.59-r0.cortexa7t2hf_neon 4/6 Verifying : lighttpd-module-indexfile-1.4.59-r0.cortexa7t2hf_neon 5/6 Verifying : lighttpd-module-staticfile-1.4.59-r0.cortexa7t2hf_neon 6/6 Installed: lighttpd-1.4.59-r0.cortexa7t2hf_neon lighttpd-module-access-1.4.59-r0.cortexa7t2hf_neon lighttpd-module-accesslog-1.4.59-r0.cortexa7t2hf_neon lighttpd-module-dirlisting-1.4.59-r0.cortexa7t2hf_neon lighttpd-module-indexfile-1.4.59-r0.cortexa7t2hf_neon lighttpd-module-staticfile-1.4.59-r0.cortexa7t2hf_neon Complete!root@desk-mx6ul-axelulite:~#</pre> == Other useful DNF commands == === List of configured software repositories === <pre class="board-terminal">root@desk-mx6ul-axelulite:~# dnf repolistrepo id repo namecortexa7hf_neon desk-mx6ul-cortexa7hfcortexa7t2hf_neon desk-mx6ul-cortexa7t2hf_neonnoarch desk-mx6ul-noarch</pre> === Search for packages === To search for an available package into the current configured channels use <code>dnf repoquery</code> Please note that this will show all packages, it'''s usually more useful to give it a pattern, e.g.: