install_dependencies issues with current github master and ubunut 14.04

Hi everyone, i recently tryed to install OF current github master on my new laptop whiwch runs lubuntu 14.04.

after rebooting, X server was broken, after checking the apt history log, i discovered that the script removed my X server to instll a new one, after reverting by uninstlalling most OF dependecies, and reinstalling the previous X server, all is fine.

let me explain, my laptop runs on xserver-xorg-core-lts-utopic (need those package to have correct drivers for recent harware), so most packages are tagged “lts-utopic”.

problem is that in the script, some gl libs have dependencies with xserver-xorg-core (not tagged lts-utopic), so apt removes every “lts-utopic” tagged packages to replace with non-tagged packages, result is a broken X.

might be simpler to understand with this extract from script :

The following extra packages will be installed:
 libegl1-mesa libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libgles2-mesa
 xserver-xorg xserver-xorg-core xserver-xorg-input-evdev
Suggested packages:
 xfonts-100dpi xfonts-75dpi xfonts-scalable
The following packages will be REMOVED:
 abiword abiword-plugin-grammar abiword-plugin-mathview libabiword-3.0
 libchamplain-0.12-0 libchamplain-gtk-0.12-0 libclutter-1.0-0
 libclutter-gtk-1.0-0 libcogl-pango15 libcogl15
 libegl1-mesa-drivers-lts-utopic libegl1-mesa-lts-utopic libgbm1-lts-utopic
 libgl1-mesa-dri-lts-utopic libgl1-mesa-glx-lts-utopic
 libglapi-mesa-lts-utopic libgles1-mesa-lts-utopic libgles2-mesa-lts-utopic
 libopenvg1-mesa-lts-utopic libwayland-egl1-mesa-lts-utopic
 libxatracker2-lts-utopic lubuntu-desktop xserver-xorg-core-lts-utopic
 xserver-xorg-input-all-lts-utopic xserver-xorg-input-evdev-lts-utopic
 xserver-xorg-input-mouse-lts-utopic xserver-xorg-input-synaptics-lts-utopic
 xserver-xorg-input-vmmouse-lts-utopic xserver-xorg-input-wacom-lts-utopic
 xserver-xorg-lts-utopic xserver-xorg-video-all-lts-utopic
 xserver-xorg-video-ati-lts-utopic xserver-xorg-video-cirrus-lts-utopic
 xserver-xorg-video-fbdev-lts-utopic xserver-xorg-video-intel-lts-utopic
 xserver-xorg-video-mach64-lts-utopic xserver-xorg-video-mga-lts-utopic
 xserver-xorg-video-neomagic-lts-utopic xserver-xorg-video-nouveau-lts-utopic
 xserver-xorg-video-openchrome-lts-utopic xserver-xorg-video-r128-lts-utopic
 xserver-xorg-video-radeon-lts-utopic xserver-xorg-video-savage-lts-utopic
 xserver-xorg-video-sisusb-lts-utopic xserver-xorg-video-tdfx-lts-utopic
 xserver-xorg-video-trident-lts-utopic xserver-xorg-video-vesa-lts-utopic
The following NEW packages will be installed:
 freeglut3-dev libegl1-mesa libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx
 libglapi-mesa libgles2-mesa libglew-dev libglu1-mesa-dev xserver-xorg
 xserver-xorg-core xserver-xorg-input-evdev
 0 upgraded, 12 newly installed, 50 to remove and 4 not upgraded.
 Need to get 0 B/5 779 kB of archives.
 After this operation, 36,5 MB disk space will be freed.
 Do you want to continue? [Y/n] n

I corrected the script by replacing libgl1-mesa-dev with libgl1-mesa-dev-lts-utopic and it seems to make the trick :

The following extra packages will be installed:
The following packages will be REMOVED:
The following NEW packages will be installed:
   freeglut3-dev libgl1-mesa-dev-lts-utopic libglew-dev libglu1-mesa-dev
0 upgraded, 5 newly installed, 1 to remove and 4 not upgraded.
Need to get 291 kB/844 kB of archives.
After this operation, 2 840 kB of additional disk space will be used.
Do you want to continue? [Y/n] y

so i does not remove lts-utopic tagged packages anymore, and i can reboot without X beeing broken.

maybe it would be a god idea to check in this install script if there is a particular tag in the xserver-xorg-core package installed on the system not to break X.

i think adding somtehing like

XTAG=$(dpkg -l |grep xserver-xorg-core|grep ii|awk '{print $2}'|sed "s/xserver-xorg-core//")

(for exemple returns -lts-utopic on my laptop, should return empty if untagged X is installed)
and putting this variable in the libgl1-mesa-dev-package could do the trick :

echo "installing OF dependencies"
apt-get install freeglut3-dev libasound2-dev libxmu-dev libxxf86vm-dev g++ libgl1-mesa-dev${XTAG} libglu1-mesa-dev libraw1394-dev libudev-dev libdrm-dev libglew-dev libopenal-dev libsndfile-dev libfreeimage-dev libcairo2-dev python-lxml python-argparse libfreetype6-dev libssl-dev libpulse-dev libusb-1.0-0-dev libgtk${GTK_VERSION}-dev  libopencv-dev libassimp-dev

should i make a pull request? or is it to specific?

anyway if it can helps pepople running into same issue :smile:

yeah if you can send a PR that’d be great. also perhaps in that case show a message in the script and ask the user for confirmation?

ok arturo, done PR Fix ubuntu install deps #3841

user is asked to confirm if he wants to install $XTAG packages only if $XTAG is not empty

Same Problem on Linux Mint 17.1 Cinnamon.
After running my x server is broken and only command line shows up. How do I fix it?

(Downloaded OF about two weeks ago and just installed it, so the above fix might not be in it)

@BerndLiefert, you should boot in rescue mode (maybe remount your Filesystem RW if it’s mount RO), then you will have to look at the apt history log (in ubuntu it’s located in /var/log/apt/). there you should see which packages were uninstalled and which were installed by OF.

i copied this entry to an other file and modified it as a script to unistall the installed packages and reinstall the uninstalled ones (cutting the packages name so that apt could handle it and adding sudo apt-get install or sudo apt-get unistall depending on what you want to do).

you will need to set up network in rescue mode for apt to download the packages.

keep thet script somewhere if you are again in this situation :smile:

could you post your apt history log to see if the fix should have work?