Fixing Dell XPS 13 "oem-kernel-cmdline" error (Ubuntu)

If you tried to update your Dell XPS 13 laptop to the latest Ubuntu version (15.10 in my case), you may have ended up with an error related to oem-kernel-cmdline preventing you to complete the update...


tl;dr

  1. do sudo nano /var/lib/dpkg/info/oem-kernel-cmdline.postrm
  2. change line 13 from configure|reconfigure) to configure|reconfigure|remove)
  3. Try to update again, it should work !

The error looks like this :

Removing oem-kernel-cmdline (1.4kittyhawk7) ...
postrm called with unknown argument `remove'
dpkg: error processing package oem-kernel-cmdline (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 oem-kernel-cmdline
E: Sub-process /usr/bin/dpkg returned an error code (1)

As the error says : postrm called with unknown argument 'remove', so the postrm script doesn't support the remove argument. So where is that script ? It's there : /var/lib/dpkg/info/oem-kernel-cmdline.postrm. As you can see in the switch case of line 12, the remove argument is not handled. So I changed the line 13 from :

configure|reconfigure)

to :

configure|reconfigure|remove)

And the problem is gone !