Installing JetPack 2.3.1 onto fresh Ubuntu 16.04

Anyone who wishes to install Jetpack version 2.3.1 directly onto a fresh 16.04 Ubuntu build (i.e. that has not been upgraded from 14.04) may run into a problem when installing.

You will be prompted to run the following command:

sudo apt-get install libopencv4tegra libopencv4tegra-dev

When you do so, you will get errors about libavcodec among others.

The following shell script should install the underlying dependencies and allow installation of libopencv4tegra and -dev.

#!/bin/sh
echo deb http://se.archive.ubuntu.com/ubuntu trusty main universe | sudo tee /etc/apt/sources.list.d/temp-trusty.list
echo deb http://security.ubuntu.com/ubuntu trusty-security main universe | sudo tee -a /etc/apt/sources.list.d/temp-trusty.list
sudo apt update
sudo apt install libavcodec54 libavformat54 libswscale2
sudo rm /etc/apt/sources.list.d/temp-trusty.list
sudo apt update

Slightly janky but worked for me. YMMV.

Just a follow-up. After following these steps, was able to upgrade my TX1 to 16.04 LTS via the .run installer, so it does lead to a stable environment.

All that’s doing is installing those 3 packages from the 14.04 repo and then removing the 14.04 repos from your updates so there are no further conflicts. Libraries should experience no harm in having older versions on the system. They can live side-by-side with newer library versions, despite whatever the package manager forces you to do.

Apparently those all come out of ffmpeg and were renamed at some point recently. What I see is

/usr/lib/x86_64-linux-gnu/libswscale-ffmpeg.so.3.1.101
replaces
/usr/lib/x86_64-linux-gnu/libswscale.so.2.1.1

/usr/lib/x86_64-linux-gnu/libavcodec-ffmpeg.so.56.60.100
replaces
/usr/lib/x86_64-linux-gnu/libavcodec.so.54.35.1

and
/usr/lib/x86_64-linux-gnu/libavformat-ffmpeg.so.56.40.101
replaces
/usr/lib/x86_64-linux-gnu/libavformat.so.54.20.4

If you attempt to install ffmpeg (and perhaps other packages), you may run into problems. When I try to install ffmpeg, apt prompts me:

The following packages will be REMOVED:
libopencv4tegra libopencv4tegra-dev

I was able to compile ffmpeg via instructions here:
https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

Also, I have issued the following as root on the management system (non-tegra):
echo libopencv4tegra hold | dpkg --set-selections
echo libopencv4tegra-dev hold | dpkg --set-selections
To prevent libopencv4tegra from being removed without my paying attention. I wouldn’t recommend unless you understand what you are doing as the errors it may generate when using apt are non-obvious.

This is only a temporary solution at best and not installing OpenCV for Tegra packages may be more stable.