Installing nvidia-opencl-icd-367 breaks the package manager

7,840

O.k. to fix this (I had the same troubles this morning) you have two ways:

1. The clean way proposed to me by the launchpad team per e-mail:

To work around this issue, you may first switch to a text console by pressing Ctrl+Alt+F1, then stop your display manager using sudo systemctl stop <displaymanager>, where is lightdm, gdm, sddm, or whichever other display manager you are using.

Stopping X clears the unmount failure, allowing you to successfully upgrade to ~gpu16.04.6, which no longer contains the defective patch, using sudo apt upgrade. At this point, you can then run sudo systemctl reboot to reboot the system, which should return it to normal functionality.

If you still receive an error indicating

Unit var-lib-snapd-lib-gl.mount not loaded.

you may work around this issue by running

sudo touch /lib/systemd/system/var-lib-snapd-lib-gl.mount && sudo systemctl daemon-reload

before attempting to repeat the upgrade. After the upgrade is complete, to clean up run

sudo touch /lib/systemd/system/var-lib-snapd-lib-gl.mount

2. The way I approached it this morning by brute forcing a complete removal:

To work around this issue, you may first switch to a text console by pressing Ctrl+Alt+F1, then start again by

sudo apt-get remove --purge nvidia*

followed by

sudo dpkg --remove --force-all nvidia-opencl-icd-367`

Then sudo apt-get autoremove followed by a sudo apt-get clean, and again a sudo apt-get remove --purge nvidia.

Now it should still mention any packages you cant remove then switch to /var/lib/dpkg/info and find the files called <packagename>.prerm, <packagename>.postinst and <packagename>.postrm, for all those files do the following (beware this is not the sane way to remove something):

sudo su
> <packagename>.prerm
> <packagename>.postinst
> <packagename>.postrm
exit

When you have done this, start the removal as usual with

sudo apt-get remove <packagename>

do this until all is purged, then

sudo apt-get update && sudo apt-get dist-upgrade

and then reinstall the nvidia driver again which should be fixed by now by

sudo apt-get install nvidia-367
Share:
7,840

Related videos on Youtube

Flatron
Author by

Flatron

Updated on September 18, 2022

Comments

  • Flatron
    Flatron almost 2 years

    I am using the graphics-drivers ppa. I got an update dialogue today which stated that I can update my nvidia driver to 367.18 (~gpu16.04.6). I started the update just like every time, but it failed with

    Failed to get unit file state for var-lib-snapd-lib-gl.mount

    After rebooting, my graphics driver was broken and I was forced to go into recovery mode.

    As usually when my Nvidia driver breaks, I just uninstall it with sudo apt purge nvidia* to reinstall it clean afterwards.

    Doing this in recovery mode uninstalled all except the nvidia-opencl-icd-367 package which failed with the error above.

    Trying to manually uninstall this package ends with these errors:

    enter image description here enter image description here


    Update @20160605 - Solution:

    Following Videonauth's answer below solves the issue. Please go through all the steps and make sure to reboot after removing everything of NVIDIA via sudo apt purge nvidia* succeeded without issues and after reinstalling the driver via sudo apt install nvidia-367.

    This shall get your driver working again.

    If this does not help, try to manually remove all old xorg configs sudo rm /etc/X11/xorg.conf* && sudo rm /etc/X11/xorg.conf and reinstall the driver again sudo apt install nvidia-367 --reinstall.

    If this still does not let you log back in (Typical error: Logins screen --> password has been entered, enter pressed --> goes back to login screen) try completely removing your Nvidia driver again from by switching into text console from the logscreen with Ctrl+Alt+F1, login with you account name and password, donwload the appropriate driver for your graphics card from here within console, stop lightdm:

    sudo service lightdm

    Install Nvidia's binary driver using sudo ./NVIDIA-VERSION...

    and reboot system:

    sudo reboot now

    System:

    Ubuntu 16.04 64bit

    Linux 4.4.0-22

    • ipeacocks
      ipeacocks about 8 years
      I can confirm that problem. And I see so far one way: disabling ppa-repo for nvidia.
    • David Foerster
      David Foerster about 8 years
      If your problem was solved in an answer, please don't replicate the steps in your question. Instead, accept the answer and vote for it. If you want to suggest changes to the answer, click the edit link below it to suggest changes.
  • Flatron
    Flatron about 8 years
    Thanks, I was able to uninstall the Nvidia driver completely following your second suggestion. I am still not on my desktop ("typical" login --> back to login screen issue), currently I am trying to install NVIDIA binary driver (which generates a new x11.conf which normally works)
  • Videonauth
    Videonauth about 8 years
    Happy i could help :) I had it this morning and had a very hard time till i figured out a way to fix. Had emailed the ppa crew about this and the 1. solutions proposed is from them, the second solution is what I did this morning to fix it.
  • Flatron
    Flatron about 8 years
    Perfect, only hassle with Linux is always the graphics driver. Mostly no issues with edgers ppa but sometimes this can make your sunday morning a struggle ;)
  • Videonauth
    Videonauth about 8 years
    I'm on unity and had the same problem and used the normal Graphics Driver Team ppa, so i removed the edgers tag from your question, it all comes from a faulty patch which got upstream, packaged and pushed.
  • binaryanomaly
    binaryanomaly about 8 years
    Thanks. The touch did the trick. Pretty silly if this can fail in such a fatal manner just because some obviously unimportant file is missing?
  • bsara
    bsara almost 8 years
    In method 1, you say to clean up to do a sudo touch ..., don't you mean sudo rm ...?
  • Videonauth
    Videonauth almost 8 years
    I really cant tell you to be honest this method I received from the maintainer of th package per mail, just posted it in to make the answer complete. I myself solved it the hardcore way described in #2. Therefore I had no chance to try the 1st variant. But as far i understood that file needs to be present afterwards, but being empty.