.. _SD.SoftwarePackagesAndTheUpdateMechanism:

.. include:: /content/swdocs.rsts

.. spelling::
   configs
   debian
   dpkg
   initrd
   io
   jetson
   Nano
   nv
   ota
   pre-dependencies
   pre-dependent
   dtbs

Software Packages and the Update Mechanism
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

NVIDIA provides additional |NVIDIA(r)| |Jetson(tm)| Linux software components and updates in APT
(Debian) repositories, accessible through the ``apt`` utility.

Installing Additional Packages
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

NVIDIA maintains the following APT repositories:

- For |NVIDIA(r)| |Jetson AGX Xavier(tm)| series
- For |NVIDIA(r)| |Jetson Xavier(tm) NX| series
- For |NVIDIA(r)| |Jetson AGX Orin(tm)|

The package ``nvidia-l4t-apt-source`` is preinstalled in the Jetson Linux root
file system. It identifies the platform it is running on and adds the
appropriate repositories to the software source list.

The packages in the APT repositories are signed with GPG keys. The
corresponding public key is preinstalled in the Jetson Linux root file system.
Once the repositories are added to the source list, ``apt`` can download and
install packages.

.. note:: The APT repositories described here are also used to upgrade existing packages and install packages that NVIDIA adds to the set initially installed with Jetson Linux. For more information, see `Updating a Jetson Device <#updating-a-jetson-device>`__.

Repackaging Debian Packages
@@@@@@@@@@@@@@@@@@@@@@@@@@@

You can use the script ``nvdebrepack.sh`` to repackage the existing Jetson Linux
Debian packages. The script can be found in the directory ``Linux_for_Tegra/tools/Debian/``. See
``Linux_for_Tegra/tools/Debian/nvdebrepack.txt``
for usage and examples.

Building Kernel Debian Packages Yourself
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

You can customize the Jetson Linux kernel by getting the kernel source packages,
making your changes, and building the Debian packages.

This section describes the package dependencies and scripts that NVIDIA
uses to build the kernel packages. You may use it as a reference to
create your own Debian packages.

Working with the Packages
@@@@@@@@@@@@@@@@@@@@@@@@@

The kernel packages are all open source. Three of the four kernel
packages are in ``public_sources.tbz2``. You can download the archive from
the NVIDIA Developer Center.

This archive contains another archive named ``kernel_src.tbz2``, which in
turn contains three directories of header files:

- ``nvidia-l4t-kernel/``
- ``nvidia-l4t-kernel-dtbs/``
- ``nvidia-l4t-kernel-headers/``

The debian.org
`Guide for Debian Maintainers <https://www.debian.org/doc/manuals/debmake-doc/index.en.html>`__
gives guidelines for modifying the open source files and creating new Debian packages from them.

The fourth kernel package, ``nvidia-l4t-jetson-io``, is discussed in
`nvidia-l4t-jetson-io <#nvidia-l4t-jetson-io>`__, below.

Package Dependencies
####################

Most Jetson Linux Debian packages pre-depend on ``nvidia-l4t-core``. This package
prevents package installation on an incompatible Jetson platform, e.g.,
installing a Jetson software package on a non-Jetson device. ``nvidia-l4t-core``
does not perform the installation if it detects an incompatible
platform.

``nvidia-l4t-core`` also prevents a **partial upgrade**, in which one Jetson Linux package upgrades to a new major release, but other Jetson Linux packages that depend on it are not upgraded as well. Partial upgrades can cause compatibility issues between firmware, programs, and libraries that have been upgraded and ones that have not.

.. todo:: The original version of the paragraph above gave an example of a "new major release" as r32.5 to r32.6, which is actually a *minor* release update. Was the example wrong, or should "major" be "minor"?

nvidia-l4t-kernel
#################

``nvidia-l4t-kernel`` contains files for the Jetson Linux kernel itself.

Pre-Dependencies and Dependencies
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

This package’s pre-dependencies are:

- ``nvidia-l4t-core`` (must match this package’s major release)

This package’s dependencies are:

- ``nvidia-l4t-tools``
- ``nvidia-l4t-init``

Package Scripts
$$$$$$$$$$$$$$$

This package has a post-installation script which you can get by
extracting the ``.deb`` file. It performs these actions:

#. Executes ``depmod -a``.

#. Creates a dpkg trigger file named ``/usr/lib/linux/triggers/<release>``.
   The trigger invokes actions defined in ``/etc/kernel/postinst.d`` to update ``initramfs/grub configs/…`` when the kernel is updated. This conforms to the standard Ubuntu kernel update procedure.

   .. todo::
      What does the ellipsis ("…") mean? Can we say "...files in the directory tree at ``initramfs/grub configs/``"?

      As a related question, what of the space in "grub configs"? Spaces are so unusual in Linux filenames that this seems likely to be an error.

nvidia-l4t-kernel-dtbs
######################

``nvidia-l4t-kernel-dtbs`` contains files for Jetson Linux’s device tree blobs (DTBs).

The package installs all of the ``.dtb`` files in ``/boot/``. When you flash a
board, it installs the ``.dtb`` file used by that board in ``/boot/dtb/`` by
checking the board specification against the DTBs’ compatibility information.

Pre-Dependencies and Dependencies
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

This package’s pre-dependencies are:

- ``nvidia-l4t-core`` (must match this package’s major release)

This package’s dependencies are:

- ``device-tree-compiler``
- ``nvidia-l4t-kernel``

Package Scripts
$$$$$$$$$$$$$$$

This package has a post-installation script, which you can get by
extracting the ``.deb`` file.

The post-installation script performs these actions:

#. Decompiles the ``.dtb`` file used by the board in ``/boot/dtb/`` and gets the
   ``bootargs`` property in the ``/chosen`` node.

#. Decompiles the corresponding ``.dtb`` file in ``/boot/`` and substitutes the
   ``bootargs`` property from step 1 in the resulting ``.dts`` file.

#. Recompiles the ``.dts`` file to a ``.dtb`` file and puts it in ``/boot/dtb/``.

nvidia-l4t-kernel-headers
#########################

``nvidia-l4t-kernel-headers`` contains Jetson Linux kernel header files.

Pre-Dependencies and Dependencies
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

This package’s pre-dependencies are:

- ``nvidia-l4t-core`` (must match this package’s major release)

This package’s dependencies are:

- ``nvidia-l4t-kernel``
- ``libc6``
- ``libssl1.1``

Package Scripts
$$$$$$$$$$$$$$$

This package has no package scripts.


nvidia-l4t-jetson-io
####################

``nvidia-l4t-jetson-io`` contains Python scripts concerned with Jetson I/O functions.

Pre-Dependencies and Dependencies
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

This package’s pre-dependencies are:

- ``nvidia-l4t-core`` (must match this package’s major release)

This package’s dependencies are:

- ``mount``
- ``python3``
- ``util-linux``
- ``nvidia-l4t-kernel``
- ``device-tree-compiler``

You can also get the dependencies by extracting the Debian file.

Package Scripts
$$$$$$$$$$$$$$$

This package has no package scripts.

Over-the-Air Update
@@@@@@@@@@@@@@@@@@@

**Over-the-Air (OTA) Update** enables you to update NVIDIA Jetson devices and host computers for Jetson development.

Jetson Linux supports two forms of OTA, which are used for different
purposes. **Debian package management-based OTA** can update Jetson
devices running Jetson Linux or Jetson components on a host computer.
**Image-based OTA** lets you create OTA payload packages, and can update
the full image running on a Jetson device, partition by partition.
The following sections describe both forms of OTA.

Updating from the NVIDIA APT Server
###################################

The first form of OTA update uses Debian packages obtained from an
NVIDIA APT server. You can use this form of OTA update to update a
Jetson device running Jetson Linux or to update |NVIDIA JetPack(tm)| components
installed on a host computer running Ubuntu. The APT server maintains
respective groups of Debian packages for each purpose.

This section describes the tools and packages that provide basic support
for Jetson Linux.

.. note::
   You cannot use OTA update to update a Jetson device on which JetPack is installed.

   To update JetPack and Jetson Linux components to a new JetPack release on a system where both are installed, see the instructions in the
   `JetPack documentation <https://docs.nvidia.com/jet son/jetpack/install-jetpack/index.html#upgrade-jetpack>`__.

   NVIDIA does not recommend installing OTA Debian packages on a Jetson Linux release earlier than release 32.3.1, or on a system that is based on Ubuntu without the customization of Jetson Linux.

Updating a Jetson Device
$$$$$$$$$$$$$$$$$$$$$$$$

Use the appropriate procedure below to update your system:

- `To update to a new point release <#to-update-to-a-new-point-release>`__
  of the same minor release; for example, from release 34.1.0 to 34.1.1

- `To update to new minor release <#to-update-to-a-new-minor-release>`__;
  for example, from release 34.0.0 to 34.1.0

To update to a new point release
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

#. Enter the command::

    $ sudo apt update

   ``apt`` reads a list of packages from the remote APT repository and identifies new and upgradable packages.

#. Enter the command::

    $ apt list --upgradable

   ``apt`` displays a list of new and upgradable packages.

#. To install the basic packages for Jetson Linux, enter the command::

    $ sudo apt upgrade

#. Reboot your Jetson device when the upgrade is finished.

To update to a new minor release
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

#. Open the ``apt`` source configuration file in a text editor, for example::

    $ sudo vi /etc/apt/sources.list.d/nvidia-l4t-apt-source.list

#. Change the repository name and download URL in the ``deb`` commands.

   The original commands are::

    deb https://repo.download.nvidia.com/jetson/common <release> main
    deb https://repo.download.nvidia.com/jetson/<platform> <release> main

   Where:

   - <release> is the release number of the minor release you want to
     update to. For example, to update to minor release 34.1, replace <release> with ``r34.1``. OTA updates to the latest point release of the specified minor release.

   - ``<platform>`` identifies the platform’s processor:

     - ``t234`` for |NVIDIA(r)| |Jetson AGX Orin(tm)|
     - ``t194`` for Jetson Xavier NX series or Jetson AGX Xavier series

   For example, if the current release is release 34.1 and your platform is Jetson AGX Orin series, the commands are::

    deb https://repo.download.nvidia.com/jetson/common r34.1 main
    deb https://repo.download.nvidia.com/jetson/t234 r34.1 main

#. Save and close the source configuration file.

#. Enter the commands::

    $ sudo apt update
    $ sudo apt dist-upgrade

   If ``apt`` prompts you to choose an option to fix local modified configuration file, reply Y for *yes* (to use the NVIDIA updated version of the file).

#. When the upgrade is finished, reboot the Jetson device.

.. note::
   - Upgrade from 34.0.0 to 34.1.0 on Jetson Xavier NX series or Jetson AGX Xavier series is not supported
   - The ``do-release-upgrade`` command is disabled because Jetson Linux does not officially support Ubuntu release 22.04 at this time.

Updating a Host
$$$$$$$$$$$$$$$

NVIDIA provides a group of Debian packages that add or update Jetson
Linux support components on the host computer.

To prepare the host computer to install Jetson Linux support components
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

#. Enter this command to install the public key of the x86_64 repository of the public APT server::

    $ sudo apt-key adv --fetch-key https://repo.download.nvidia.com/jetson/jetson-ota-public.asc

#. Add the following x86_64 repository to the host system’s source list.

   - For an Ubuntu 18.04 host::

        deb http://repo.download.nvidia.com/jetson/x86_64/bionic <relno> main

   - For an Ubuntu 20.04 host::

        deb http://repo.download.nvidia.com/jetson/x86_64/focal <relno> main

   Where ``<relno>`` is the current release’s full release number as specified in the *Release Notes*.

   .. todo:: Add *Release Notes* link.

#. Enter the command::

    $ sudo apt update

#. Use ``apt`` to download and install the required packages.

   - For an Ubuntu 18.04 host::

        $ sudo apt-get install cuda-toolkit-11-4 cuda-cross-aarch64-11-4 \
              libnvvpi2 vpi2-dev vpi2-cross-aarch64-l4t python3-vpi2 \
              python3.9-vpi2 vpi2-samples nsight-systems-2021.5.4 \
              nsight-graphics-for-embeddedlinux-2021.5.1

   - For an Ubuntu 20.04 host::

        $ sudo apt-get install cuda-toolkit-11-4 cuda-cross-aarch64-11-4 \
              libnvvpi2 vpi2-dev vpi2-cross-aarch64-l4t python3-vpi2 \
              python3.9-vpi2 vpi2-samples nsight-systems-2021.5.4 \
              nsight-graphics-for-embeddedlinux-2021.5.1

Debian Packages on the NVIDIA APT Server
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

This section lists the Debian packages maintained on the NVIDIA APT
server for a Jetson device or a host.

Update Packages for Jetson Devices
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Following is a list of OTA update packages for BSP on Jetson devices as
of Jetson Linux release 34.1.

.. todo::
   Update.

   Very preferably, change the instructions to direct the user to an automatically compiled list of packages, so that the list in the *Developer Guide* does not have to be updated manually for each release. The same applies to the "List of JetPack OTA Packages" mentioned below.

For a list of other OTA packages and instructions for applying them, see “List of JetPack OTA Packages” in
`JetPack SDK <https://docs.nvidia.com/jetson/jetpack/index.html>`__.

.. spelling_disable::

=============== ===================================
Component group Packages
=============== ===================================
BSP             - jetson-gpio-common
                - nvidia-l4t-3d-core
                - nvidia-l4t-apt-source
                - nvidia-l4t-bootloader
                - nvidia-l4t-camera
                - nvidia-l4t-configs
                - nvidia-l4t-core
                - nvidia-l4t-cuda
                - nvidia-l4t-display-kernel
                - nvidia-l4t-firmware
                - nvidia-l4t-gputools
                - nvidia-l4t-graphics-demos
                - nvidia-l4t-gstreamer
                - nvidia-l4t-init
                - nvidia-l4t-initrd
                - nvidia-l4t-jetson-io
                - nvidia-l4t-jetson-multimedia-api
                - nvidia-l4t-jetsonpower-gui-tools
                - nvidia-l4t-kernel
                - nvidia-l4t-kernel-dtbs
                - nvidia-l4t-kernel-headers
                - nvidia-l4t-libvulkan
                - nvidia-l4t-multimedia
                - nvidia-l4t-multimedia-utils
                - nvidia-l4t-nvfancontrol
                - nvidia-l4t-nvpmodel
                - nvidia-l4t-nvpmodel-gui-tools
                - nvidia-l4t-nvsci
                - nvidia-l4t-oem-config
                - nvidia-l4t-optee
                - nvidia-l4t-pva
                - nvidia-l4t-tools
                - nvidia-l4t-wayland
                - nvidia-l4t-weston
                - nvidia-l4t-x11
                - nvidia-l4t-xusb-firmware
                - python-jetson-gpio
                - python3-jetson-gpio
=============== ===================================

.. spelling_enable::

Update Packages for Hosts
%%%%%%%%%%%%%%%%%%%%%%%%%

The following table lists Jetson Linux support components that you can
install with apt on a host, and the packages that contain them.

.. spelling_disable::

================== ==============================================
Component group    Packages
================== ==============================================
CUDA               - cuda-11-4
                   - cuda-cccl-11-4
                   - cuda-command-line-tools-11-4
                   - cuda-compat-11-4
                   - cuda-compiler-11-4
                   - cuda-cudart-11-4
                   - cuda-cudart-dev-11-4
                   - cuda-cuobjdump-11-4
                   - cuda-cupti-11-4
                   - cuda-cupti-dev-11-4
                   - cuda-cuxxfilt-11-4
                   - cuda-demo-suite-11-4
                   - cuda-documentation-11-4
                   - cuda-driver-dev-11-4
                   - cuda-drivers-470
                   - cuda-drivers-fabricmanager-470
                   - cuda-drivers-fabricmanager
                   - cuda-drivers
                   - cuda-gdb-11-4
                   - cuda-gdb-src-11-4
                   - cuda-libraries-11-4
                   - cuda-libraries-dev-11-4
                   - cuda-minimal-build-11-4
                   - cuda-nsight-11-4
                   - cuda-nsight-compute-11-4
                   - cuda-nsight-systems-11-4
                   - cuda-nvcc-11-4
                   - cuda-nvdisasm-11-4
                   - cuda-nvml-dev-11-4
                   - cuda-nvprof-11-4
                   - cuda-nvprune-11-4
                   - cuda-nvrtc-11-4
                   - cuda-nvrtc-dev-11-4
                   - cuda-nvtx-11-4
                   - cuda-nvvp-11-4
                   - cuda-runtime-11-4
                   - cuda-samples-11-4
                   - cuda-sanitizer-11-4
                   - cuda-toolkit-11-4-config-common
                   - cuda-toolkit-11-4
                   - cuda-toolkit-11-config-common
                   - cuda-toolkit-config-common
                   - cuda-tools-11-4
                   - cuda-visual-tools-11-4
                   - cuda
                   - libcublas-11-4
                   - libcublas-dev-11-4
                   - libcufft-11-4
                   - libcufft-dev-11-4
                   - libcurand-11-4
                   - libcurand-dev-11-4
                   - libcusolver-11-4
                   - libcusolver-dev-11-4
                   - libcusparse-11-4
                   - libcusparse-dev-11-4
                   - libnpp-11-4
                   - libnpp-dev-11-4
                   - libnvidia-cfg1-430
                   - libnvidia-cfg1-470
                   - libnvidia-common-430
                   - libnvidia-common-470
                   - libnvidia-compute-430
                   - libnvidia-compute-470
                   - libnvidia-decode-430
                   - libnvidia-decode-470
                   - libnvidia-encode-430
                   - libnvidia-encode-470
                   - libnvidia-extra-470
                   - libnvidia-fbc1-430
                   - libnvidia-fbc1-470
                   - libnvidia-gl-430
                   - libnvidia-gl-470
                   - libnvidia-ifr1-430
                   - libnvidia-ifr1-470
                   - libnvidia-nscq-470
                   - libnvjpeg-11-4
                   - libnvjpeg-dev-11-4
                   - libxnvctrl-dev
                   - libxnvctrl0
                   - nsight-compute-2021.2.4
                   - nsight-systems-2021.5.2
                   - nvidia-compute-utils-430
                   - nvidia-compute-utils-470
                   - nvidia-dkms-430
                   - nvidia-dkms-470
                   - nvidia-driver-430
                   - nvidia-driver-470
                   - nvidia-fabricmanager-470
                   - nvidia-fabricmanager-dev-470
                   - nvidia-gds
                   - nvidia-headless-430
                   - nvidia-headless-470
                   - nvidia-headless-no-dkms-430
                   - nvidia-headless-no-dkms-470
                   - nvidia-kernel-common-430
                   - nvidia-kernel-common-470
                   - nvidia-kernel-source-430
                   - nvidia-modprobe
                   - nvidia-utils-430
CUDA cross-compile - cuda-cccl-cross-aarch64-11-4
                   - cuda-cross-aarch64-11-4
                   - cuda-cross-aarch64
                   - cuda-cudart-cross-aarch64-11-4
                   - cuda-cupti-cross-aarch64-11-4
                   - cuda-driver-cross-aarch64-11-4
                   - cuda-nsight-compute-addon-l4t-11-4
                   - cuda-nvcc-cross-aarch64-11-4
                   - cuda-nvml-cross-aarch64-11-4
                   - cuda-nvprof-cross-aarch64-11-4
                   - cuda-nvrtc-cross-aarch64-11-4
                   - cuda-nvtx-cross-aarch64-11-4
                   - libcublas-cross-aarch64-11-4
                   - libcudla-cross-aarch64-11-4
                   - libcufft-cross-aarch64-11-4
                   - libcurand-cross-aarch64-11-4
                   - libcusolver-cross-aarch64-11-4
                   - libcusparse-cross-aarch64-11-4
                   - libnpp-cross-aarch64-11-4
                   - nsight-compute-addon-l4t-2021.2.4
Computer Vision    - libnvvpi2
                   - vpi2-dev
                   - vpi2-cross-aarch64-l4t
                   - python3-vpi2
                   - python3.9-vpi2
                   - vpi2-samples
Developer Tools    - nsight-graphics-for-embeddedlinux-2021.5.1
                   - nsight-systems-2021.5.4
================== ==============================================

.. spelling_enable::

Customizing Debian Packages
$$$$$$$$$$$$$$$$$$$$$$$$$$$

You can customize Debian packages to help you implement your solution,
for example, by adding support for your carrier board. For more
information, see
`Repackaging Debian Packages <#repackaging-debian-packages>`__
and
`Building Kernel Debian Packages Yourself <#building-kernel-debian-packages-yourself>`__.

Downloading Debian Packages for Later Use
#########################################

As an alternative to installing Debian packages on a Jetson device or
host from the APT server, you can download packages and store them, and
later install them manually.

To download packages, open the
`NVIDIA Jetson repository <https://repo.download.nvidia.com/jetson/>`__
in a web browser. This page displays a list of Debian packages for each
JetPack release and processor. Each package name is a hyperlink; to download a
package, click its link.

.. todo:: The processors are listed by their name: ``t194``, etc. We need to revisit Winnie's decision that we will not mention processor names in the *Developer Guide*. If the purpose is to relieve the reader of having to understand them, we cannot do it.

Updating Jetson Linux with Image-Based Over-the-Air Update
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

**Image-Based Over-the-Air Update** is a failsafe way to update BSP on a
Jetson device by writing pre-generated images to the partitions. It can
update many old BSP versions to newer ones. This feature will be supported
in next public release.

.. todo::
   At this point the section "Updating Jetson Linux with Image-Based Over-the-Air Update" has been removed from the file because it is not supported in r34.1, although it was supported in r32.x. See email from Kary Jin, 2/16/2022 @17:52. It has been saved in SoftarePackagesAndTheUpdateMechanism/UpdatingJetsonLinuxWithImageBasedOverTheAirUpdate.rst.txt. It is to be re-introduced in a later release when the feature is supported.

