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 means if you built your image and did not not use
these variables as part of the build and your image is
now running on the target, you need to perform the
steps in this section if you want to use runtime
package management.
PACKAGE_FEED_*
variables, see
PACKAGE_FEED_ARCHS
,
PACKAGE_FEED_BASE_PATHS
,
and
PACKAGE_FEED_URIS
in the Yocto Project Reference Manual variables
glossary.
On the target, you must inform DNF that package
databases are available.
You do this by creating a file named
/etc/yum.repos.d/oe-packages.repo
and defining the oe-packages
.
As an example, assume the target is able to use the
following package databases:
all
, i586
,
and qemux86
from a server named
my.server
.
The specifics for setting up the web server are up to
you.
The critical requirement is that the URIs in the
target repository configuration point to the
correct remote location for the feeds.
deploy
directory.
However, for production use, it is better to copy
the package directories to a location outside of
the build area and use that location.
Doing so avoids situations where the build system
overwrites or changes the
deploy
directory.
When telling DNF where to look for the package databases, you must declare individual locations per architecture or a single location used for all architectures. You cannot do both:
Create an Explicit List of Architectures: Define individual base URLs to identify where each package database is located:
[oe-packages] baseurl=http://my.server/rpm/i586 http://my.server/rpm/qemux86 http://my.server/rpm/all
This example informs DNF about individual package databases for all three architectures.
Create a Single (Full) Package Index: Define a single base URL that identifies where a full package database is located:
[oe-packages] baseurl=http://my.server/rpm
This example informs DNF about a single package database that contains all the package index information for all supported architectures.
Once you have informed DNF where to find the package databases, you need to fetch them:
# dnf makecache
DNF is now able to find, install, and upgrade packages from the specified repository or repositories.