package nvidia-331 331.113-0ubuntu0.1 failed to install/upgrade: subprocess installed post-removal script returned error exit status 8

Bug #1401591 reported by Daniel Heidfeld
178
This bug affects 41 people
Affects Status Importance Assigned to Milestone
nvidia-graphics-drivers-331 (Ubuntu)
Expired
High
Unassigned

Bug Description

I switched to the Nvidia driver not long before I updated the OS to the latest version.

ProblemType: Package
DistroRelease: Ubuntu 14.10
Package: nvidia-331 331.113-0ubuntu0.1
ProcVersionSignature: Ubuntu 3.16.0-26.35-generic 3.16.7-ckt1
Uname: Linux 3.16.0-26-generic x86_64
ApportVersion: 2.14.7-0ubuntu8
Architecture: amd64
Date: Wed Dec 10 20:45:45 2014
DuplicateSignature: package:nvidia-331:331.113-0ubuntu0.1:subprocess installed post-removal script returned error exit status 8
ErrorMessage: subprocess installed post-removal script returned error exit status 8
InstallationDate: Installed on 2014-12-05 (6 days ago)
InstallationMedia: Ubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140722.2)
SourcePackage: nvidia-graphics-drivers-331
Title: package nvidia-331 331.113-0ubuntu0.1 failed to install/upgrade: subprocess installed post-removal script returned error exit status 8
UpgradeStatus: Upgraded to utopic on 2014-12-11 (0 days ago)
modified.conffile..etc.modprobe.d.nvidia.331.hybrid.conf: [deleted]

Revision history for this message
Daniel Heidfeld (dlheidfeld) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Yoda (jofe) wrote :

I have the same issue here.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nvidia-graphics-drivers-331 (Ubuntu):
status: New → Confirmed
Revision history for this message
Chris Cowan (macil) wrote :

I'm having this too. It's refusing to let me remove the nvidia-331 package.

Revision history for this message
Chris Cowan (macil) wrote :

On my machine (Ubuntu 14.10), dpkg's output at the end goes a bit differently:

DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
stop: Unknown job: nvidia-persistenced
userdel: user nvidia-persistenced is currently used by process 2035
dpkg: error processing package nvidia-331 (--remove):
 subprocess installed post-removal script returned error exit status 8
Processing triggers for libc-bin (2.19-10ubuntu2.1) ...
Processing triggers for man-db (2.7.0.2-2) ...
Errors were encountered while processing:
 nvidia-331
Log ended: 2014-12-17 22:12:31

The difference from OP is the "stop: Unknown job: nvidia-persistenced" line. My machine has no such job nvidia-persistenced, but it does have a user and a process running by that name. (OP's log shows "stop: Unknown instance: ", which indicates there was a job by that name, but it wasn't currently running.)

The issue appears to be because of this part in nvidia-331's postrm:

        # Remove the nvidia-persistenced user
        if id "$NVPD_USER" > /dev/null 2>&1; then
            stop nvidia-persistenced || true
            userdel "$NVPD_USER"
        fi

On my machine, there is no such job "nvidia-persistenced". It fails to stop that job and continues, but my machine does have a nvidia-persistenced process running, so the following userdel line fails and causes the package uninstallation to abort. The correct way to stop nvidia-persistenced appears to be "/usr/bin/stop-nvidia-persistenced", but that file is already removed by the time that nvidia-331's postrm is run. The "stop nvidia-persistenced || true" line should be removed, and "/usr/bin/stop-nvidia-persistenced" should be added to prerm's remove) section. I just tested that on my local machine and saw that change makes removing the package work correctly.

Changed in nvidia-graphics-drivers-331 (Ubuntu):
importance: Undecided → High
Revision history for this message
Andrea Gioffré (andreagioffre) wrote :

I always have to suspend my local machine because the video output became freezed. i tried to install the open-source driver but i can't remove nvidia drivers. i'm using ubuntu 14.10 and nvidia geforce 710M.

Revision history for this message
james (charja13) wrote :

This is getting annoying, I went to only install lebtool and it told me yet again, and i couldent install lebtools either because of it for some odd reason

Revision history for this message
Chris Kankiewicz (phlak) wrote :

I ran into this bug last night trying to reinstall my Nvidia drivers (nvidia-331-updates) and couldn't uninstall them. Running 14.10 on the provided kernel. Can provie any additional information if needed.

Revision history for this message
ber4444 (ber-44) wrote :

Same here, esp. frustrating due to another bug, https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/1387134 which often freezes the Nvidia driver - but now we cannot even downgrade from it, so we are left with that Nvidia shit.

Revision history for this message
Stefan Leitner (s-o-l) wrote :

@ber4444 the frustrating bug you mentioned is fixed with a patch you have to apply yourself. it happens with hybrid graphics and the proprietary nvidia driver.

workaround is to use a usb mouse instead of the touchpad.

Nikhil Mahale (nmahale) created a working patch: https://bugs.launchpad.net/xorg-server/+bug/1220426/comments/171

So i have the same problem, i can't uninstall the proprietary nvidia driver from GUI, so i had to follow guides like this:
http://askubuntu.com/questions/206283/how-can-i-uninstall-a-nvidia-driver-completely

Revision history for this message
Stefan Leitner (s-o-l) wrote :

same bug appears when you try to uninstall the nvidia-331-updates driver:

https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-331-updates/+bug/1401597

Revision history for this message
Jeb E. (jebeld17) wrote :

I'm getting this issue too!
I reported it to Kernel.org and Nvidia as well :(

Revision history for this message
Jeb E. (jebeld17) wrote :

Would you consider this a duplicate bug of 1268257?

Revision history for this message
schlypel (schlypel) wrote :

I found that the process of removing nvidia driver / returning to nouveau is prevented by a running service (nvidia-persistenced).
to get rid of the proprietary driver, do: "sudo kill <id of process>" and then you can use the hardware driver dialog to return to nouveau.
To find the id just do "ps -e | grep nvidia-persistenced"

Revision history for this message
Jason Lenz (jason-t-lenz) wrote :

The solution posted by @schlypel worked for me. Thank you! The only issue I had was that the running service didn't show up for me using the grep string shown. It was called "nvidia-persiste" or something along those lines. I would recommend finding the id by typing a shortened version in the grep string, such as "ps -e | grep nvidia-pers"

Revision history for this message
sipa (sipa) wrote :

The solution posted by @schlypel worked for me too. As for @jason-t-lenz, it was not called "nvidia-persistenced" but "nvidia-persiste".
I could then install nvidia-331-updates with no issues.

Revision history for this message
sipa (sipa) wrote :
Download full text (5.5 KiB)

My output when failing:

Removing libcuda1-331 (331.113-0ubuntu0.1) ...
Removing nvidia-331-uvm (331.113-0ubuntu0.1) ...
Removing all DKMS Modules
Done.
Removing nvidia-331 (331.113-0ubuntu0.1) ...
Removing all DKMS Modules
Done.
update-alternatives: using /usr/lib/nvidia-331-prime/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf (x86_64-linux-gnu_gl_conf) in auto mode
update-alternatives: using /usr/lib/nvidia-331-prime/alt_ld.so.conf to provide /etc/ld.so.conf.d/i386-linux-gnu_GL.conf (i386-linux-gnu_gl_conf) in auto mode
update-alternatives: using /usr/lib/x86_64-linux-gnu/mesa/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf (x86_64-linux-gnu_gl_conf) in auto mode
update-alternatives: using /usr/lib/i386-linux-gnu/mesa/ld.so.conf to provide /etc/ld.so.conf.d/i386-linux-gnu_GL.conf (i386-linux-gnu_gl_conf) in auto mode
INFO:Disable nvidia-331
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
stop: Unknown job: nvidia-persistenced
userdel: user nvidia-persistenced is currently used by process 4117
dpkg: error processing package nvidia-331 (--remove):
 subprocess installed post-removal script returned error exit status 8
Removing nvidia-opencl-icd-331 (331.113-0ubuntu0.1) ...
Processing triggers for libc-bin (2.19-10ubuntu2.2) ...
Processing triggers for man-db (2.7.0.2-2) ...
Errors were encountered while processing:
 nvidia-331
E: Sub-process /usr/bin/dpkg returned an error code (1)

It seems the error occurs while doing some changes on the user "nvidia-persistenced", that is used by the process 4117 (nvidia-persiste)
I got the name of the process with:

# sudo ps -e | grep nvidia
=> 4117 ? 00:00:00 nvidia-persiste

And killed it:
# sudo kill 4117

Then could install with no issues and the output shows the operation on the user "nvidia-persistenced" is now successful:

Removing nvidia-331 (331.113-0ubuntu0.1) ...
stop: Unknown job: nvidia-persistenced
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.103ubuntu8) ...
update-initramfs: Generating /boot/initrd.img-3.16.0-30-generic
Processing triggers for libc-bin (2.19-10ubuntu2.2) ...
Selecting previously unselected package libcuda1-331-updates.
(Reading database ... 358904 files and directories currently installed.)
Preparing to unpack .../libcuda1-331-updates_331.113-0ubuntu0.1_amd64.deb ...
Unpacking libcuda1-331-updates (331.113-0ubuntu0.1) ...
Selecting previously unselected package nvidia-331-updates.
Preparing to unpack .../nvidia-331-updates_331.113-0ubuntu0.1_amd64.deb ...
Unpacking nvidia-331-updates (331.113-0ubuntu0.1) ...
Selecting previously unselected package nvidia-331-updates-uvm.
Preparing to unpack .../nvidia-331-updates-uvm_331.113-0ubuntu0.1_amd64.deb ...
Unpacking nvidia-331-updates-uvm (331.113-0ubuntu0.1) ...
Selecting previously unselected package nvidia-opencl-icd-331-updates.
Preparing to unpack .../nvidia-opencl-icd-331-updates_331.113-0ubuntu0.1_amd64.deb ...
Unpacking nvidia-opencl-icd-331-updates (331.113-0ubuntu0...

Read more...

Revision history for this message
belissner (benyo09) wrote :

The solution posted by @schlypel worked for me too. I searched nvidia-persitenced with htop. THX for solution!

Jonas (jbelmont41)
Changed in nvidia-graphics-drivers-331 (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for nvidia-graphics-drivers-331 (Ubuntu) because there has been no activity for 60 days.]

Changed in nvidia-graphics-drivers-331 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.