I want to install OpenCV (with GTK) latest stable version on my Arch Linux. I know how to manually build and install the library, but I don't want to go through all that. Is there a way to get it via pacman. I know that packages are available for qt but its causing issues for me. I am using Gnome.

  • Strictly answering your question, pacman lets you install packages from the official repositories only, without affecting how packages are compiled. You may search the AUR for an alternative version or file bug reports about the issues you are facing with the official package or take advantage of the ABS to compile your own version. You may want to reword your question a bit, to clarify what kind of solution would be acceptable/preferable to you. – fra-san Oct 5 '20 at 12:05
  • @fra-san I went through a long list of AUR packages but couldn't find any package with gtk support. But I am not sure about opencv-git, it has gtk in its dependencies list. Also, I am not sure about its stability. Can you confirm? – Mansoor Ahmed Memon Oct 5 '20 at 15:02
  • Sorry, I'm unfortunately not able to comment on that, nor on other AUR packages. – fra-san Oct 5 '20 at 16:23
  • I am using opencv-git package. I have tweaked the PKGBUILD file a bit to support GTK instead of QT. – Mansoor Ahmed Memon Oct 6 '20 at 8:10
  • Glad to know that! If that solution works for you it would be great if you could post it as an answer to your own question, to make it clear that your problem is solved (or at least that you've found something working). Thank you! – fra-san Oct 6 '20 at 8:50

I couldn't find a package for opecv in either the main repo or aur that supports GTK by default. So, I decided to use the opencv-git. I added the required flags to the PKGBUILD file in cmake_opts which are:


and build the package just as usual.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.