Cups Printer Management from Command Line

Refer: https://www-uxsup.csx.cam.ac.uk/pub/doc/suse/suse9.1/adminguide9.1/ch05s07.html

Sample Commands

Help

lpstat --help

General Status

lpstat -t

List of Printers

lstat -v

5.7.3.Using Command-Line Tools for CUPS Troubleshooting

Print jobs will be kept in the printer queue if you shut down the system while a job is being processed. This means a broken print job will still be there even after rebooting and you need to remove it from the queue manually with the commands mentioned above.

Other problems occur if there is some fault in the physical data link between the computer and the printer. The printer may then be unable to make sense of the data it receives and start spitting out lots of pages with garbage on them.

To make sure the printer stops working, first remove all paper from it (in the case of inkjet printers) or open the paper trays (laser printers).

At this point, the print job will often still be in the queue, because jobs are only removed from the queue when all data has been sent to the device. Check which queue is currently printing by entering

lpstat -o

Then remove the problematic print job wit

cancel queuename-jobnumber

Some data might still find their way to the printer in spite of the job having been deleted. To stop this, enter the command fuser -k /dev/lp0 (for a printer at the parallel port) or fuser -k /dev/usb/lp0 (for a USB printer). This kills any processes still using the printer device.

Do a complete reset of the printer by disconnecting it from power for some time. Then put in the paper and switch the printer back on.

Copy Printer Setup HL2170W and Canon_MX920_Series

Refer: https://www.cyberciti.biz/tips/linux-migrate-printer-configuration.htm

Files for Setup:  home-printer-setup.zip

How to export Linux printer setup
$ sudo tar -cvzf /tmp/cups-$(hostname).tar.gz /etc/cups

Now login to new system and type the following commands:
$ cp original-filename.tar.gz /tmp/cups-$(hostname).tar.gz

$ sudo su
$ mv /etc/cups /etc/cups.backup
$ cd /
$ tar -zxvf /tmp/cups*

Finally, restart the cups service:
Refer: https://help.ubuntu.com/lts/serverguide/cups.html

$ /etc/init.d/cupsys restart

Refer: https://haydenjames.io/finding-linux-compatible-printers/

Fixing Windows Printer Problems

Advanced
If the previous troubleshooting step is not successful, you may need to clear spooler files and restart the spooler service.

  • In the search box on the taskbar, type Services, then select the search result of the same name.
  • In the Services list, double-tap (or double-click) Print Spooler. Select Stop > OK.
  • In the search box on the taskbar, type %WINDIR%\system32\spool\printers, select the file folder in the search results, and then delete all files in the folder.
  • Search for and open Services again
  • In the Services list, double-tab (or double-click) Print Spooler.
  • Select Start, and in the Startup Type list, make sure that Automatic is selected, and then select OK.

Refer: https://support.microsoft.com/en-us/help/4027397/windows-10-fix-printer-problems

Installing New Network Printer Vista to XP Shared

Go to Control Panel. Choose printer. Then choose Add Printer.

ChooseAdd a local printer. Click on Create a new port. The default in the drop down box is Local Port. Do not change that. Click Next.

A dialogue box will appear asking for you to enter a port name. Type in the \\computer name\printer name such as \\Gt5040\HPDJ940C