How to Re-Enroll Ubuntu Secure Boot Keys

This is kind of a shoe-in for the MaxwellHackswell main site, but I wanted to get this up quickly.

Problem

I was recently installing DisplayLink drivers on an Ubuntu computer, and I ran screwed up right at the beginning. When doing an initial install, the Terminal enters a Secure Boot configuration where you create signed driver keys to load into the Secure Boot database.

DisplayLink details the process here:
How to use DisplayLink Ubuntu driver with UEFI Secure Boot? – DisplayLink Support

The issue is, when you reboot, you need to enroll the keys in Secure Boot immediately, or they won't work and you're not prompted again on the next boot.

How to fix?

The key is already cached in the OS, and we just need to install in the Secure Boot at startup.

I tried uninstalling and reinstalling the driver, but no luck.

We can initiate the key enrollment process by opening Terminal and running the following code:

sudo apt install --reinstall displaylink-driver
sudo update-secureboot-policy --enroll-key

And rebooting! Then we can go through the steps detailed by DisplayLink support and enroll the new key in Secure Boot. I don't know how critical it was to reinstall the drivers right before enrolling the key, but I included it here in case you run into an issue.