Jp7.2 install nvidia-jetpack change kernel bsp

hi nvidia:

on our custom carrier board, Our BSP is based on r39.2.0, so we do
not want to install the r39.2.1 packages. when I install nvidia-jetpack, our kernel image and KO change,and kernel version change. how to keep our r kernel image and KO and kernel version when I install nvidia-jetpack?

Hi @helianyi1 ,

Maybe you can follow this post to solve this problem.

Thanks!!

this can no solve my issue, I want to install nvidia-jetpack, but I also want to keep my bsp like kernel Image , KO, DTB, BOOTAA64.efi l4t_initrd.img, uefi_t26x_general.bin, because I customize those files

You may try use sdkmanager to generate the image then replace those files you want to keep the flash it.

You could try this to see if it could lock down to Jetpack 7.2.0.

cat pin-jetpack-7.2.sh

#!/usr/bin/env bash
#
# Keep a Jetson on JetPack 7.2.0 GA / L4T 39.2.0.
#
# Protects:
#   nvidia-l4t-*     -> allow only versions belonging to L4T 39.2.0
#   nvidia-jetpack*  -> allow only JetPack 7.2 GA (7.2-*)
#
# Run this script as root:
#   sudo ./pin-jetpack-7.2.sh

set -euo pipefail

L4T_RELEASE="39.2.0"
JETPACK_RELEASE="7.2.0"

PREF_FILE="/etc/apt/preferences.d/00-jetpack-7.2-ga"
BACKUP_SUFFIX=".pre-pin-$(date +%Y%m%d-%H%M%S)"

log()
{
    printf '\n\033[1;34m==>\033[0m %s\n' "$*"
}

warn()
{
    printf '\n\033[1;33m!!\033[0m %s\n' "$*" >&2
}

die()
{
    printf '\n\033[1;31mXX\033[0m %s\n' "$*" >&2
    exit 1
}

[[ $EUID -eq 0 ]] || die "Run as root: sudo $0"


# 1. Sanity checks


log "Checking that this is a Jetson"

[[ -r /etc/nv_tegra_release ]] ||
    die "/etc/nv_tegra_release not found."

printf '    '
head -n1 /etc/nv_tegra_release

# 2. Check currently installed L4T packages

log "Checking installed nvidia-l4t-* package versions"

bad_l4t=0

while IFS=$'\t' read -r pkg version status; do
    [[ "$status" == "installed" ]] || continue

    printf '    %-45s %s\n' "$pkg" "$version"

    case "$version" in
        *"${L4T_RELEASE}-"*)
            ;;
        *)
            warn "$pkg is not an L4T ${L4T_RELEASE} package: $version"
            bad_l4t=1
            ;;
    esac

done < <(
    dpkg-query -W \
        -f='${binary:Package}\t${Version}\t${db:Status-Status}\n' \
        'nvidia-l4t-*' 2>/dev/null || true
)

if (( bad_l4t )); then
    die "System contains nvidia-l4t packages outside ${L4T_RELEASE}; refusing to label it pinned."
fi

# 3. Install APT preferences
# APT uses the FIRST matching specific-form record.
#
# Therefore the allowed version MUST appear before the catch-all
# rejection record.


log "Writing $PREF_FILE"

cat >"$PREF_FILE" <<EOF
# JetPack 7.2 GA / L4T 39.2.0 lock
#
# Allow L4T 39.2.0 packages.
#
# The leading '*' is intentional.  

Package: nvidia-l4t-*
Pin: version *${L4T_RELEASE}-*
Pin-Priority: 990

# Reject every other nvidia-l4t-* version.
# This includes 39.2.1, 39.3, 39.4, 40.x, etc.

Package: nvidia-l4t-*
Pin: version *
Pin-Priority: -1


# JetPack metapackages have JetPack versions rather than L4T versions:
#
#   7.2-b184
#   7.2-b187
#   7.2.1-b49
#
# "7.2-*" permits 7.2 GA builds but does NOT match 7.2.1.

Package: nvidia-jetpack*
Pin: version ${JETPACK_RELEASE}-*
Pin-Priority: 990

# Reject later/different JetPack metapackage versions.

Package: nvidia-jetpack*
Pin: version *
Pin-Priority: -1
EOF

# 4. Hold the currently installed L4T / JetPack packages as a second layer of protection.

log "Holding installed nvidia-l4t-* / nvidia-jetpack* packages"

mapfile -t HOLD_PKGS < <(
    dpkg-query -W \
        -f='${binary:Package}\t${db:Status-Status}\n' \
        'nvidia-l4t-*' 'nvidia-jetpack*' 2>/dev/null |
    awk '$2 == "installed" { print $1 }' |
    sort -u
)

if (( ${#HOLD_PKGS[@]} == 0 )); then
    warn "No matching installed packages found."
else
    printf '    %s\n' "${HOLD_PKGS[@]}"
    apt-mark hold "${HOLD_PKGS[@]}" >/dev/null
fi

# 5. Refresh package metadata and show policy

log "Refreshing APT metadata"

apt-get update

log "Verifying policy for representative packages"

for pkg in nvidia-l4t-core nvidia-l4t-kernel nvidia-jetpack; do
    if apt-cache show "$pkg" >/dev/null 2>&1; then
        printf '\n----- %s -----\n' "$pkg"
        apt-cache policy "$pkg"
    fi
done

# 6. Show held packages

log "Held NVIDIA Jetson packages"

apt-mark showhold |
    grep -E '^nvidia-(l4t-|jetpack)' ||
    true

log "Jetson BSP locked to L4T ${L4T_RELEASE} / JetPack ${JETPACK_RELEASE} GA."

after sudo ./pin-jetpack-7.2.sh

sudo apt install nvidia-jetpack -y
[sudo] password for walker:
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
nvidia-l4t-gstreamer : Depends: nvidia-l4t-camera (= 39.2.1-20260806224157) but 39.2.0-20260601141651 is to be installed
Depends: nvidia-l4t-core (= 39.2.1-20260806224157) but 39.2.0-20260601141651 is to be installed
Depends: nvidia-l4t-multimedia (= 39.2.1-20260806224157) but 39.2.0-20260601141651 is to be installed
Depends: nvidia-l4t-multimedia-utils (= 39.2.1-20260806224157) but 39.2.0-20260601141651 is to be installed
Depends: nvidia-l4t-nvsci (= 39.2.1-20260806224157) but 39.2.0-20260601141651 is to be installed
N: Ignoring file ‘00-jetpack-7.2-ga’ in directory ‘/etc/apt/preferences.d/’ as it has an invalid filename extension
E: Unable to correct problems, you have held broken packages.

Hi,

I suggest you to try flashing your board with JP7.2.0, using the sdk-manager and install the components you need. Then, you can install your customized binaries.
Here, is a guide that can be helpful.

As second option, I suggest you to try reflashing your board as you currently do (to make sure there’s no version mismatching with your current tests), then try to inspect which the versions of the packages are available:

apt-cache madison nvidia-jetpack
apt-cache policy nvidia-jetpack
apt-cache madison nvidia-l4t-gstreamer
apt-cache madison nvidia-l4t-camera
apt-cache madison nvidia-l4t-multimedia

If the repository exposes the GA package, install that specific version, e.g. conceptually:

sudo apt install nvidia-jetpack=<7.2-GA-version>

rather than the unversioned:

sudo apt install nvidia-jetpack

Also, try to install only the packages you need.

Enrique Ramirez
Embedded SW Engineer at RidgeRun
Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com
Website: www.ridgerun.com

I was looking in the docs for something else and just saw this that could help with keeping your kernel.

kernel customization

To prevent apt upgrade from unintentionally overriding your custom kernel, 
you need to rename the kernel and initramfs images, and then update extlinux.conf. 

It includes steps to accomplish that.


Following might help resolve the apt error you got. This removes the apt holds only; it does not remove the APT pin in /etc/apt/preferences.d/00-jetpack-7.2-ga. So the 39.2.0/7.2.0 version restriction would still remain active.

apt-mark showhold | grep -E '^nvidia-(l4t-|jetpack)' | xargs -r sudo apt-mark unhold

Then as @enrique.ramirez suggests:

sudo apt install nvidia-jetpack=7.2-b187