If your Ubuntu machine shows a printer error like “Printer not connected” or a job stuck in the queue that won’t cancel, it’s usually a stalled CUPS service or a corrupted print job. This guide walks you through clearing the queue, restarting CUPS, and resolving common driver and connection errors—without needing to reinstall anything.
What You’ll Need
- A user account with
sudoprivileges - Access to a terminal (Ctrl+Alt+T)
- Your printer’s model name (optional, but helpful for driver fixes)
Step-by-Step
- Check the current queue status. Open a terminal and run
lpstat -o. This lists all pending jobs. If you see jobs stuck in “processing” or “held”, note their job IDs (e.g.,printer-123). - Cancel all jobs with a single command. Run
cancel -ato cancel every job on all printers. If that fails, trycancel -a printer-name(replaceprinter-namewith the name fromlpstat -p). - Force-remove stuck jobs. If jobs remain, use
lpstat -W not-completedto see them, then cancel individually withcancel job-id. For truly stubborn jobs, stop CUPS first:sudo systemctl stop cups, then delete the job cache files:sudo rm -f /var/spool/cups/*(this removes all pending jobs). - Restart the CUPS service. Run
sudo systemctl start cups(orsudo systemctl restart cupsif it was already running). Then check status withsystemctl status cups—it should show “active (running)”. - Verify the printer is enabled and accepting jobs. Run
cupsenable printer-nameandcupsaccept printer-name. Then test withlp -d printer-name /etc/nsswitch.confto print a test file. - Check the error log if problems persist. Look at
sudo tail -f /var/log/cups/error_logwhile trying to print. Common messages include “filter failed” (driver issue) or “connection refused” (network issue). - Reinstall the printer driver if needed. Go to Settings → Printers, remove the printer, then add it again. For USB printers, unplug and replug after removal. For network printers, ensure the IP address is correct in the printer’s settings.
- As a last resort, purge and reinstall CUPS. Run
sudo apt purge cups, thensudo apt install cups. This resets configuration, so back up any custom settings first.
Common Mistakes
- Not using sudo for system commands. Commands like
systemctl stop cupsrequire admin rights; without sudo, they fail silently. - Deleting the wrong spool files. Removing files in
/var/spool/cupsis safe only when CUPS is stopped. Doing it while running can corrupt the queue. - Ignoring the printer’s own error state. If the printer shows “offline” on its display, no software fix will help. Check paper, ink, and physical connections first.
- Assuming the queue is the only issue. A stuck job is often a symptom of a driver problem. If jobs fail immediately after clearing, focus on the driver.
Tips
- Use the CUPS web interface. Open
http://localhost:631in a browser. You can manage printers, view jobs, and cancel them graphically—sometimes easier than the terminal. - Set a default printer. Run
lpoptions -d printer-nameto avoid sending jobs to the wrong device. - Enable debug logging. Run
sudo cupsctl --debug-loggingto get detailed logs in/var/log/cups/error_log. Turn it off later withsudo cupsctl --no-debug-logging. - Keep drivers updated. For many printers, the built-in driver in Ubuntu works fine. If not, check the manufacturer’s website for a Linux .deb package, but avoid generic “universal” drivers unless necessary.
- Use a different driver as a test. In Printer Properties, try switching to a generic PostScript or PCL driver to see if the issue is driver-specific.
Troubleshooting
If the steps above don’t resolve the issue, here’s what to try next:
- Job still stuck after cancel? Restart the printer itself (power off, wait 10 seconds, power on). This clears the printer’s internal memory, which can hold a job hostage.
- “Filter failed” error? This usually means the driver is missing or broken. Reinstall the driver package, or try a different driver as mentioned. Also check if the printer is set to the correct model in Settings.
- Network printer not found? Verify the printer’s IP address with
ping printer-ip. If it doesn’t respond, the printer may be off or on a different subnet. Re-add the printer using its hostname instead of IP if possible. - CUPS won’t start? Run
journalctl -u cupsto see why. Common causes: corrupted configuration file (/etc/cups/cupsd.conf) or a port conflict. Rename the config file (sudo mv /etc/cups/cupsd.conf /etc/cups/cupsd.conf.bak) and restart—CUPS will create a default one. - Permission denied when deleting spool files? Ensure CUPS is stopped and you’re using sudo. If the directory is owned by another user, use
sudo chown -R lp:lp /var/spool/cupsto fix ownership.
Frequently Asked Questions
Why does my print queue get stuck so often?
Frequent stuck queues often point to a flaky network connection or a driver that crashes. Check the printer’s connection (USB or Wi-Fi) and consider updating the driver. Also, avoid sending large or complex PDFs that may overwhelm the printer’s memory.
Can I clear the queue without restarting CUPS?
Yes, cancel -a usually works without restarting. If jobs remain, you may need to stop CUPS to delete the spool files, but try the simple cancel first.
What does “printer is not responding” mean?
This means the computer can’t communicate with the printer. Check that the printer is powered on, connected to the network (if wireless), and that the USB cable is secure. Try pinging the printer’s IP address if it’s network-connected.
How do I reset the CUPS configuration to defaults?
You can rename the configuration files and restart CUPS: sudo mv /etc/cups/cupsd.conf /etc/cups/cupsd.conf.bak and sudo mv /etc/cups/printers.conf /etc/cups/printers.conf.bak, then sudo systemctl restart cups. This will create fresh defaults, but you’ll need to re-add your printers.
Is it safe to delete files in /var/spool/cups?
Yes, but only when CUPS is stopped. Those files are temporary print jobs. Deleting them while CUPS is running could cause errors, so always stop the service first.
Why does my printer work on Windows but not Ubuntu?
This is usually a driver issue. Windows has manufacturer-provided drivers, while Ubuntu relies on open-source drivers. Check if your printer is supported by the open-source driver project (most are). If not, you may need to install a proprietary driver from the manufacturer, or use a generic driver.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Fix OneNote App Not Working on Android
- Move Games to SSD Without Reinstalling
- Move Windows 11 Taskbar to Top or Side: Easy Steps
- Windows 11 Calendar Wrong Day? Fix It Here
- How to Use curl Command in Linux
- Install ChromeOS: Convert Laptop to Chromebook