Today on my Linux Mint install (21.2) I got the error cups-pki-invalid
when trying to print a document.
In this short blog post, we’re going to fix it, without having to remove/re-install printers.
A quick Google search shows that this is likely due to an expired certificate, but we knew that anyway with “pki” in the error code, didn’t we?
Why this certificate doesn’t re-gen (or have a longer expiry) is unknown to me, but it is what it is, and we’ll fix the error.
The Fix
I have a Xerox Printer which is on my local network (ethernet), so these steps may differ if you’ve got a printer connected via USB.
First off we need to locate the problem/expired certificate. The command below will list all of the certificates cups has
sudo ls /etc/cups/ssl
Next, we’ll need to remove the expired certificate for the printer in question. I only have one printer on my network, so I could happily remove all files with a .crt
extension in that folder. However, I’m more cautious, so I prefer to only remove what I know needs deleting.
The output of the ls
command above gives me:
Xerox.local.crt
Excellent - confirmed! I only have one certificate for my Xerox printer and that must be the expired one.
Now we just need to delete that expired certificate:
sudo rm /etc/cups/ssl/Xerox.local.crt
Finally, by simply restarting the cups
service, cups
will notice that the printer doesn’t have a corresponding certificate (.crt
file) for the printer and re-generate one for you. Restart the cups
service like so:
sudo service cups restart
And now, when you next go to print, you wont see the cups-pki-invalid
error.
Thanks for reading!
comments powered by Disqus