Q:

sudo fails because of `pam_mount.c` assertion

I just upgraded to Kubuntu 12.04 from 11.10.
Now when I use sudo I almost always get:
sudo: pam_mount.c:417: modify_pm_count: Assertion `user != ((void *)0)' failed.

It makes the command fail.
What is up with that and how can I fix it?

A:

Login with a root account with sudo bash. You can also do this from a live CD. 
Or you need to reboot and do issue a sudo bash with the 1st command (it looks like this bug only shows up after the 2nd time you use sudo).
sudo gedit /etc/pam.d/common-session-noninteractive

look for line 16(ish) and change 
[default=1] 

to 
[default=0]

Try a command with sudo and it should work as normal.
Source from launchpad

