[Guide] Upgrading Jetson Xavier NX to Ubuntu 22.04 for ROS2 Humble Support (with Known Issues)

Background

The Jetson Xavier NX officially supports up to Ubuntu 20.04, but ROS2 Humble requires Ubuntu 22.04. Since NVIDIA has not yet provided an official Ubuntu 22.04 image for Xavier NX, we followed the approach shared in the community project xronos-inc/jetson-nano-ubuntu-22.04 and successfully upgraded our Xavier NX to Ubuntu 22.04, which is now running ROS2 Humble smoothly.

⚠️ Disclaimer: This is an unofficial method. Please back up your data and proceed with caution.


1. Preparing for Ubuntu 22.04 Upgrade

The following commands are executed directly on the Jetson Xavier NX via SSH or using a connected keyboard, mouse, and display.

1.1 Remove Docker

The Docker version in Ubuntu 20.04 is outdated. It should be removed before the upgrade. A more modern version can be installed afterward.

sudo apt remove --purge docker docker.io containerd
sudo rm -rf /etc/docker

1.2 Remove Ubuntu 18.04 Desktop Applications

Remove desktop applications from Ubuntu, even if you plan to install the Ubuntu Desktop later. This helps avoid upgrade errors—especially from Chromium, which can cause upgrade failures. It’s better to remove these applications now and install the newer versions after the upgrade.

sudo apt remove --purge chromium-*
sudo apt remove --purge libreoffice*
sudo apt remove --purge thunderbird*
sudo apt remove --purge ffmpeg smplayer* vlc-*
sudo apt remove --purge youtube-dl
sudo apt remove --purge mobile-broadband-provider-info modemmanager
sudo apt remove --purge example-content

Also remove Java before the upgrade. You can install a newer version afterward.

sudo apt remove --purge openjdk*

1.3 Remove Ubuntu Desktop

Change the default target to multi-user.target so the system boots into a terminal instead of X Windows.

sudo systemctl set-default multi-user.target
sudo reboot

After rebooting, remove the Ubuntu desktop components:

sudo apt remove --purge --auto-remove \
    ubuntu-desktop \
    ubuntu-gnome-desktop \
    ubuntu-artwork \
    ubuntu-wallpaper* \
    gnome-* libgnome* \
    plymouth-theme* \
    light-themes \
    kde-window-manager kinit kwin-common kwin-x11 \
    lxde lxde-* lxdm lxlock lxsession* \
    xserver* \
    xorg \
    x11-common x11-utils \
    unity unity-* \
    gdm gdm3 \
    lightdm \
    libgtk* gtk-* \
    xwayland \
    nautilus nautilus-* \
    zeitgeist-core libzeitgeist*

Remove snap (it will be reinstalled during the upgrade process):

sudo apt remove --purge --autoremove snapd

Clean up unused packages and reboot:

sudo apt autoremove
sudo reboot

2. Upgrading Jetson Xavier NX to Ubuntu 22.04

First, upgrade all packages on the current system to the latest version:

sudo apt update
sudo apt upgrade

Install Vim and edit the update manager configuration file to allow distribution upgrades:

sudo apt install vim
sudo vim /etc/update-manager/release-upgrades

In the opened file, set:

Prompt=normal

Start the upgrade process:

sudo do-release-upgrade

Once the upgrade is complete, reboot and log in again.

Restore the NVIDIA L4T APT source list:

sudo mv /etc/apt/sources.list.d/nvidia-l4t-apt-sources.list.distUpgrade /etc/apt/sources.list.d/nvidia-l4t-apt-sources.list

Then update and upgrade again:

sudo apt update
sudo apt upgrade

3. (Optional) Install Ubuntu Desktop (Partially Functional)

If you want to use the Ubuntu Desktop interface, you can install it here. Note that some GUI applications (such as Settings) currently may not work properly under Ubuntu 22.04. However, this does not affect the use of ROS 2 Humble.

sudo apt install ubuntu-desktop

Fix SSSD startup error

sudo cp /usr/lib/aarch64-linux-gnu/sssd/conf/sssd.conf /etc/sssd/
sudo chmod 600 /etc/sssd/sssd.conf

Enable GDM to launch the desktop environment:

sudo systemctl enable gdm

To ensure GDM starts automatically on boot, edit the service file:

sudo vim /usr/lib/systemd/system/gdm.service

Add the following at the end of the file:

[Install]
WantedBy=multi-user.target

Known issue: Settings app (gnome-control-center) won’t launch

This issue is caused by a Jetson-specific symbolic link:
libdrm.so.2 is linked to NVIDIA’s custom libdrm_nvdc.so, which is not ABI-compatible with the standard libdrm.so.2.4.0. As a result, graphical apps like the Settings panel fail to start.

As a workaround, you can preload the standard DRM library when launching GNOME settings:

LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libdrm.so.2.4.0 gnome-control-center

This workaround allows the Settings app to open, but it’s not persistent. If anyone knows a more permanent solution, please share it.

Hi,

Thanks for the detailed guidelines.

I followed your steps and successfully upgraded to Ubuntu 22.04 due to the issue with ROS2 and Ubuntu 20.04 being EOL

I have the following questions.

  1. At the moment, I get the following message

Building dependency tree… Done

Reading state information… Done

The following packages will be REMOVED:

cuda-11-4 cuda-command-line-tools-11-4 cuda-compiler-11-4 cuda-cuobjdump-11-4 cuda-cupti-11-4 cuda-cupti-dev-11-4 cuda-cuxxfilt-11-4 cuda-documentation-11-4 cuda-gdb-11-4 cuda-libraries-dev-11-4 cuda-nvdisasm-11-4 cuda-nvml-dev-11-4 cuda-nvprune-11-4 cuda-nvtx-11-4 cuda-profiler-api-11-4 cuda-samples-11-4 cuda-sanitizer-11-4 cuda-toolkit-11-4 cuda-tools-11-4 cuda-visual-tools-11-4 libcudla-dev-11-4 libcufft-dev-11-4 libcurand-dev-11-4 libcusolver-dev-11-4 libcusparse-dev-11-4 libnpp-dev-11-4 vulkan-tools

0 to upgrade, 0 to newly install, 27 to remove and 0 not to upgrade.

After this operation, 1,478 MB disk space will be freed.

I know this happens because the upgrade process breaks the dependency tree. What should be the next step? If I remember correctly, AGX Xavier only supports CUDA 11.4, so I will have to either ignore this or use

sudo apt-mark hold …

command to hold the packages so that I don’t accidentally remove them. Please advice what you did.

  1. Can I repeat the process to push to Ubuntu 24.04 ? have you tried that. I simply tried the command and Update is available.

  2. It seems like disk usage went up from 16GB to 18 GB. is this normal or are there any cleaning I have to do? I would like to use the Jetson as a server (without GUI) to squeeze the max out, but /etc contains x11 folders. do I have to uninstall anything?

Follow up,

I was going through 1. CUDA for Tegra — CUDA for Tegra 13.0 documentation and tried running

sudo apt-get install -y cuda-compat-12-2

which didn’t work. but tried

sudo apt-get install -y cuda

and it solved the broken above dependencies by installing “cuda 11.4.19-1”

Mid update,

There is a typo in

sudo mv /etc/apt/sources.list.d/nvidia-l4t-apt-sources.list.distUpgrade /etc/apt/sources.list.d/nvidia-l4t-apt-sources.list

which should be

sudo mv /etc/apt/sources.list.d/nvidia-l4t-apt-source.list.distUpgrade /etc/apt/sources.list.d/nvidia-l4t-apt-sources.list

And when upgrading to Ubuntu 24.04, there is one issue. Ubuntu 24.04 uses .source file instead of .list file from Ubuntu 22.04. The upgrade process automatically converts the .list file into .source but the repos are disabled. To enable,

Check the contents of the correct file:

cat /etc/apt/sources.list.d/nvidia-l4t-apt-source.sources

You will likely see something like this, with the key line being Enabled: no:

Enabled: no
Types: deb
URIs: https://repo.download.nvidia.com/jetson/common
Suites: r35.6
Components: main

Edit the file to enable the repository:

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

find the lines that says Enabled: no. Change it to Enabled: yes. It should show as

Enabled: yes
Types: deb
URIs: https://repo.download.nvidia.com/jetson/common
Suites: r35.6
Components: main

Then save the file and run,

sudo apt update
sudo apt upgrade

This wouldn’t change much but adds the repos back.

Final Update.

I ended up with following issues after the above steps.

  • Docker related issue could not be fixed.
  • Used space in storage balooned up to 19GB.

Because of these issues, I decided to re flash and follow this approach Guide to Minimizing Jetson Disk Usage

I kept the original kernel, Docker, and Jetpack combination on my device, which enables Docker-based functionality.

Since I’ll be using this as headless, stripped the GUI and other packages (removed ubuntu-desktop) as explained here Step 1: Removing GUI - Guide to Minimizing Jetson Disk Usage and [Guide] Upgrading Jetson Xavier NX to Ubuntu 22.04 for ROS2 Humble Support (with Known Issues)

Then reinstalled ubuntu-server to make sure all critical components are in place. After updating and upgrading, I ended up with,

  • Working Docker (kept original) vith nvidia-container
  • Used space 5.2 GB / 28 GB
  • Idle RAM usage 607 MB / 14.5 GB