Score:1

How to install libopencv-highgui3.2 on WSL Ubuntu 22.04?

ar flag

I recently decided to follow some books to learn machine learning with c++. According to the material, I need this package libopencv-highgui3.2.

I'm using WSL with Ubuntu 22.04.

I tried:

sudo apt install  libopencv-highgui3.2

Got this

The following packages have unmet dependencies:
 libopencv-imgcodecs3.2 : Depends: gdal-abi-2-2-3 but it is not installable
                          Depends: libgdal20 (>= 2.0.1) but it is not installable
                          Depends: libgdcm2.8 but it is not installable
                          Depends: libilmbase12 (>= 1.0.1) but it is not installable
                          Depends: libopenexr22 but it is not going to be installed
 libopencv-videoio3.2 : Depends: libavcodec57 (>= 7:3.4.4) but it is not going to be installed or
                                 libavcodec-extra57 (>= 7:3.4.4) but it is not going to be installed
                        Depends: libavformat57 (>= 7:3.4.4) but it is not going to be installed
                        Depends: libdc1394-22 but it is not installable
E: Unable to correct problems, you have held broken packages.

I tried to use the deb file, same output .

I tried sudo aptitude install and sudo apt-get install but neither worked.

I also tried to install the individual packages

~$ sudo apt install gdal-abi-2-2-3  libgdal20 libgdcm2.8 libilmbase12 libopenexr22
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libgdal20 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package libilmbase12 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package gdal-abi-2-2-3 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package libgdcm2.8 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'gdal-abi-2-2-3' has no installation candidate
E: Package 'libgdal20' has no installation candidate
E: Package 'libgdcm2.8' has no installation candidate
E: Package 'libilmbase12' has no installation candidate

I am super naive to Linux.

I read this package is for Ubuntu 18.01 but not for 22.04. Does that mean I can not install it? Is there any replacement?

hr flag
Books are sometimes out of date (especially with fast moving development packages like opencv, boost etc.). Do you know that you need libopencv-highgui3.2 specifically? 22.04 has libopencv-highgui4.5d for example. In either case, you should probably install the *development* package `libopencv-highgui-dev` and let apt figure out the appropriate binary package version as a dependency
lovemyway avatar
ar flag
@steeldriver Thank you. The book is from 2020. It says “All code examples have been tested with the Arch and Ubuntu 18.04 Linux distributions. The following list outlines the packages you'll need to install on the Ubuntu platform”, The list include, among other packages, libopencv-core3.2 libopencv-imgproc3.2 libopencv-dev libopencv-highgui3.2 libopencv-highgui-dev, these 5 which looks like revelant for opencv. Honestly I do not know if all will be needed. I am just trying to install all of them and this is the only one that I failed to install.
lovemyway avatar
ar flag
@Nmath I think it is. I have also tried those commands. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. I am using the app ubuntu 22.04, not a full linux system though.
hr flag
If you are using (WSL?) Ubuntu 22.04, it shouldn't even be possible to install opencv v3.2 components AFAIK - have you done something ill-advised like add 18.04 repositories to your sources.list?
lovemyway avatar
ar flag
@steeldriver Yes, I am using WSL. I do not really understand what you mean by adding 18.04 repositiories. The only change I made to my sources.list is I added this line deb http://security.ubuntu.com/ubuntu bionic-security main universe
lovemyway avatar
ar flag
@Nmath Thank you for the information. I do intend to try coding in linux as well. I guess that means I have to install the full Ubuntu, not just the WSL?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.