Install Ubuntu 20.04 on Jetson Nano - Q-engineering
Q-engineering
Q-engineering
Go to content
images/empty-GT_imagea-1-.png
Ubuntu 20.04 on Jetson Nano

Install Ubuntu 20.04 on Jetson Nano

Last updated: September 9, 2021

Introduction.

The Jetson Nano comes with an Ubuntu 18.04 version. In some situations, you need Ubuntu 20.04. Especially when Python 3.8 is required, as is the case with the popular ROS2 software. This guide discusses the upgrade to Ubuntu 20.04 on the Jetson Nano. We are going to use the standard upgrade mechanism of Ubuntu operating systems.

Preparations.

First of all, make sure you have enough space on your SD card to perform the upgrade. You need at least 16 GB of free space.
The following action is to remove any software packages you don't need right away, such as LibreOffice. It slows down the whole procedure and you can easily reinstall them if needed.
Chromium should also be removed as it will interfere with Snap installs. You can do this by using the software updater or by command line.

Ubuntu software

Once removed, update, upgrade and clean your system.
# remove Chromium and OpenCV
$ sudo apt-get remove --purge chromium-browser chromium-browser-l10n
# refresh your system
$ sudo apt-get update
# need nano for editing some files
$ sudo apt-get install nano
$ sudo apt-get upgrade
$ sudo apt-get autoremove
Next, you need to enable distribution upgrades in the update manager by settting prompt=normal in the /etc/update-manager/release-upgrades file.
As usual, close with <Ctrl>+<X>, <Y> and <Enter>.
$ sudo nano /etc/update-manager/release-upgrades
Release updates

With the update manager set, we need to refresh the software database again. Once done, you can reboot.
# refresh your system again
$ sudo apt-get update
$ sudo apt-get dist-upgrade
$ sudo reboot

Upgrade to Ubuntu 20.04.

With all preparations made, it's time for the upgrade to Ubuntu 20.04. It will take several hours. Unfortunately, some input is required throughout the procedure as there are questions to be answered. Check your screen now and then. Answer all questions with the suggested default value.
# upgrade to Ubuntu 20.04
$ sudo do-release-upgrade
StartUpgrade

After entering <y>, the transformation will take place. As mentioned, some questions are asked during the process. Always confirm the default value. There may also be a notification that a new Ubuntu version is available, the Hirsute Hippo 21.04 version. Please cancel that notification, as we won't be installing that version for a while.
When Ubuntu 20.04 is installed, all obsolete files can be removed from your drive, as the screen shows.

none

Now that the packages have been removed, Ubuntu will ask for a restart. Don't reboot now! That's really important.

Don't reboot

You need to check some files and make some changes before Ubuntu can reboot. If you forget this, you will get a warning every time Ubuntu starts. So do it right away.
First, check that WaylandEnable=false is uncommented in the /etc/gdm3/custom.conf file.

Wayland

Uncomment (remove the hash before the line) Driver "nividia" in the file /etc/X11/xorg.conf.

Driver nvidia

Finally, reset the upgrade manager to never.

none

Now you can safely reboot the system.
# check and editing some files
$ sudo nano /etc/gdm3/custom.conf
$ sudo nano /etc/X11/xorg.conf
$ sudo nano /etc/update-manager/release-upgrades
$ sudo reboot

Starting Ubuntu 20.04 on your Nano.

A few preparations are needed before you can fully enjoy Ubuntu 20.04 on your Jetson Nano.
Start with the well-known update, upgrade and autoremove cycle. You will get probably no upgrades as Ubuntu is just installed. However, autoremove will free a lot of memory by deleting obsolete files.
Finally, remove an annoying circular symbolic link in /usr/share/applications that makes the same app appear 86 times in your software overview.
# prepare your system
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get autoremove
# remove circular symlink
$ sudo rm /usr/share/applications/vpi1_demos
# remove distorted nvidia logo in top bar
$ cd /usr/share/nvpmodel_indicator
$ sudo mv nv_logo.svg no_logo.svg

The last action is to re-enable the original NVIDIA repositories, which were disabled during the upgrade. In the folder /etc/apt/sources.list.d/ you will find the five files that needed to be changed. Open each file with $ sudo nano and remove the hash in front of the line to activate the repository.

none

gcc-8.

Ubuntu 20.04 comes with gcc version 9.3.0.

Gcc9Ub20

Some software packages, especially the CUDA software, requires a gcc version 8. We shall install this version besides the already available version 9. With a simple command, you can now switch between the two versions. The gcc compiler is always accompanied by the corresponding g++ compiler. The latter will also be installed.
# install gcc and g++ version 8
$ sudo apt-get install gcc-8 g++-8
# setup the gcc selector
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8
# setup the g++ selector
$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 8
# if you want to make a selection use these commands
$ sudo update-alternatives --config gcc
$ sudo update-alternatives --config g++
Always select the two corresponding versions at the same time.  Otherwise, very obscure errors may occur during compilation. As mentioned, if you want to compile software that requires CUDA or cuDNN, such as OpenCV, choose version 8.
Your choice is saved and applied system-wide. Even after a reboot, the selected pair is still active. The only way to change the versions is to resubmit the command.

SelectorUb20

The same goes for the clang compilers. In this case, the CUDA and cuDNN need version 8, while Ubuntu installs default version 10. You can either install version 8 right away with $ sudo apt-get install clang-8 or install more versions and create an sudo update-alternatives --config just like above.

Final remarks.

Ubuntu 20.04 is now fully functional on your Jetson Nano. You can customize the installation further to your own needs.
We were surprised by how long it takes for some assignments to complete. When we set up the dphys swap mechanism for the OpenCV installation, it took five nerve-wracking minutes for the reboot to complete. We stare at a blank screen all the time. So be patient is the advice in such cases.
We also had to disable the power-saving blank screen option in the settings as it gives unstable results when rebooting from sleep mode.
SleepUb20
There are reasons why Nvidia doesn't ship Ubuntu 20.04 with its JetPacks. It certainly has to do with the little added value compared to version 18.04. But there will also be other reasons. Therefore, see this Ubuntu 20.04 version as an experiment. That's why it comes without any warranty, and we cannot provide (technical) support in any way.

We would like to thank Bob Davis for his contribution to this page. Without his input, this page would not be published.
Raspberry 64 OS
Raspberry 32 OS
Raspberry and alt
Raspberry Pi 4
Jetson Nano
images/GithubSmall.png
images/YouTubeSmall.png
images/SDcardSmall.png
Back to content