Today I had run an update to my Ubuntu 14.10 installation, and after it I get some errors about the nvidia-331 driver so I wanted to remove it and reinstall it, every time to do so the apt-get purge nvidia-331 fail and i got this error

devh@devh-PC:~$ sudo apt-get -y purge nvidia-331
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-generic linux-image-generic thermald
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 184 MB disk space will be freed.
(Reading database ... 243902 files and directories currently installed.)
Removing nvidia-331 (331.113-0ubuntu0.1) ...
stop: Unknown job: nvidia-persistenced
userdel: user nvidia-persistenced is currently used by process 1612
dpkg: error processing package nvidia-331 (--remove):
 subprocess installed post-removal script returned error exit status 8
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

I get the same error when i try to install any other package.

  • Kill the process nvidia-persistenced first: sudo killall nvidia-persistenced. – Jos Feb 15 '15 at 10:54
  • thank you for the trick that i could not try it because i had uninstall ubuntu and put arch in his place thank you. – Houssem Ghiat Feb 17 '15 at 10:51

I see that you have already solved your issue. This is just for others searching for answers to their similar problem in a proper answer form.

I have had this same issue when playing around with drivers. To solve it, I did the following:

  1. Open a terminal
  2. Run sudo apt-get purge nvidia-331. This wont't work, but take note of the process id it mentions when it complains:

    userdel: user nvidia-persistenced is currently used by process 1612

  3. Run sudo kill [process_id] to kill the process mentioned above. Note that your process id will most certainly differ, don't use the one above!

  4. Then re-run sudo apt-get purge nvidia-331

It should now work.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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