If you, like me, installed OpenCV from the Ubuntu package manager on a computer with an Intel graphics card, you might have been thinking you bricked your installation and would have to start from scratch. Thanks to some good work by a few other Ubuntu users, I as able to remedy this problem and get my desktop back. Moral of the story: don’t install OpenCV from the repos. Somebody in charge of the package dependencies made it depend in a round-about way on NVidia packages, which breaks the desktop for Intel graphics chips.
My symptoms are these: when I booted my Dell Inspiron laptop with an Intel graphics card, the boot process would make it all the way to the login screen. I would enter my credentials, log in, and be met by a blank black screen with my mouse cursor. I could move the pointer around, but without a window manager or file manager or anything, I couldn’t do anything graphically.
This fix had two parts: first, I had to remove the offending packages. This was done by running the following command:
$ sudo apt-get install ocl-icd-libopencl1
…and then running:
$ sudo apt-get autoremove
…Which removes all the redundant packages that
libopencv-dev brought in, leaving you with a generic version of
libopencl1. This takes care of the nvidia package problems, but when you reboot, you still don’t get Unity back. What’s up with that?
Unity runs as a Compiz plugin in Ubuntu. In some cases, installing the wrong packages like those above will cause the settings in Compiz that start Unity to be unset. You will need to install the Compiz configuration tool:
sudo apt-get install compizconfig-settings-manager compiz-plugins-extra
Then, after reboot and login (to the graphical desktop that lacks Unity), type Ctrl+t to open a terminal and run:
…to start the manager. Look for the Unity plugin when the manager comes up, click on it, and make sure it gets enabled.
…And that’s it! Your machine should be back up and running right without needing to re-install the desktop or unity and without having to re-install the OS. In the mean time, let’s hope that whoever made the mistake of making opencv-dev depend on all that stuff gets their act together and fixes it.