OpenCV build error on Jetpack 5.1.2

Hi All,

I tried building OpenCV for my Jetpack5.1.2 as per the below link: which says the script works fine, by removing the previous OpenCV version 4.5.4 which was by default installed with the nvidia-Jetpack installation.

I am getting below error:

After this operation, 404 kB of additional disk space will be used.
Get:1 Index of /ubuntu-ports focal-updates/main arm64 libcurl4 arm64 7.68.0-1ubuntu2.21 [216 kB]
Get:2 Index of /ubuntu-ports focal-updates/main arm64 curl arm64 7.68.0-1ubuntu2.21 [157 kB]
Fetched 372 kB in 12s (31.8 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
(Reading database … 165273 files and directories currently installed.)
Preparing to unpack …/libcurl4_7.68.0-1ubuntu2.21_arm64.deb …
Unpacking libcurl4:arm64 (7.68.0-1ubuntu2.21) over (7.68.0-1ubuntu2.18) …
Selecting previously unselected package curl.
Preparing to unpack …/curl_7.68.0-1ubuntu2.21_arm64.deb …
Unpacking curl (7.68.0-1ubuntu2.21) …
Setting up libcurl4:arm64 (7.68.0-1ubuntu2.21) …
Setting up curl (7.68.0-1ubuntu2.21) …
Processing triggers for man-db (2.9.1-1) …
Processing triggers for libc-bin (2.31-0ubuntu9.9) …

** Download opencv 4.6.0 (2/4)

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:–:-- 0:00:09 --:–:-- 0curl: (6) Could not resolve host:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:–:-- 0:01:00 --:–:-- 0
curl: (56) OpenSSL SSL_read: Connection reset by peer, errno 104
unzip: cannot find or open, or
unzip: cannot find or open, or
rm: cannot remove ‘’: No such file or directory
rm: cannot remove ‘’: No such file or directory
./ line 52: cd: opencv-4.6.0/: No such file or directory

** Build opencv 4.6.0 (3/4)

CMake Error: The source directory “/home/trident/Downloads/workspace” does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
make: *** No targets specified and no makefile found. Stop.

** Install opencv 4.6.0 (4/4)

make: *** No rule to make target ‘install’. Stop.
** Install opencv 4.6.0 successfully
** Bye :)

Please let me know how to resolve this error.


curl: (56) OpenSSL SSL_read: Connection reset by peer, errno 104

Based on the above error, could you double-check if the network of Xavier works correctly?


Thanks for the updates.

In continuation i have few more queries, pls clarify.

  1. With my nvidia-jetpack installation for Jetpack 5.1.2, by default OpenCV 4.5. was installed.
    When I ran this script it asked to remove the previous version of openCV.
    should I say “yes” or no" ?

Is it OK, if we remove 4.5.4 version and install “4.6” Open CV ?

  1. What is the approximate build time it takes?

  2. As I wanted to complete OpenCV install with CUDA enabled soon, I followed the method suggested in the below youtube link:

Is this method also fine?

One more thing I observed is this build is taking more time as mentioned in the youtube video.
Also during build, the default python version it took for building was python 2.7. Will there be any issues with this ?
We nee to build against Python3.8 is what I assume as that is the latest version.

  1. If things wont work out with this youtube suggested method, I will try the
    "" script method again by uninstalling currently installed OpenCV 4.5.4

  2. In the .sh script can I change the revision to 4.5.4 and do the install so that it installs OpenCV 4.5.4 instead of “4.6.0”


Will this works fine?

Thanks in advance.


1. Dependent on your use case.
It’s okay to remove the default version and install OpenCV 4.6.

2. Around 1 hr.

3. You can give it a try. But we have only verified the script.
For python3, please make sure you have added the python config.

5. Yes, if the version is valid, the script will build the corresponding source automatically.


I installed 4.5.4 only which is compatible as part of Jetpack 5.1.2. It got built and installed fine with CUDA enabled.

It took around 1.5 to 2 hours.

Both your script installation method and youtube method worked fine and got installed.

Did not understand this. How to add python config?

Yes. It built Opencv 4.5.4 version successfully.


It looks like you already got OpenCV installed.
Is that correct?


In one of the Jetson device, I installed through your script method.
In another unit, installed it through youtube method.
Both compiled and installed fine with CUD enabled.

I verified this in both the units using “Jtop” command.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.