How to install OpenCV 4.2.0 with CUDA 10.2 in Ubuntu distro 18.04 First of all install update and upgrade your system: $ sudo apt update $ sudo apt upgrade Then, install required libraries: