Bring printing online on a Rocky Linux host by enabling the CUPS service, validating queues, and managing print jobs from the CLI. Set a system default printer, submit and cancel a job, and identify the two configuration files that control the daemon and queues.
You’ve been asked to bring printing online on a new Rocky Linux
host. A queue already exists (Demo_Printer), but
printing is not confirmed operational. You need to start and
enable CUPS, inspect printer state, set a default destination,
submit a test job, and demonstrate you can cancel stuck jobs.
You also need to locate the core config files that control CUPS
behavior.
Printing incidents are usually service state, queue state (enabled/accepting), default destination, or job control. This workflow gives you a repeatable “bring it online and prove it works” checklist.
systemctl enable --now.
lpstat and queue/job
inspection with lpq.
cupsenable and
cupsaccept.
lpadmin -d.
lp and
cancel.
cupsctl.
/etc/cups.
sudo systemctl enable --now cups
This is the “bring it online” action. --now
starts the service immediately and enable ensures
it starts after reboot.
systemctl status cups
lpstat -t
lpstat -t gives the “what’s configured and what’s
running” view: scheduler state, default destination, and
printer queue status.
# Look for:
# scheduler is running
# printer Demo_Printer is idle. enabled ...
sudo cupsenable Demo_Printer && sudo cupsaccept Demo_Printer
These two states are separate. A queue can be enabled but not accepting jobs, or accepting jobs but disabled. You want both true for normal operations.
lpstat -t
sudo lpadmin -d Demo_Printer
Setting a default destination prevents “works for me” behavior where a user prints without specifying a queue and nothing happens because no default is defined.
lpstat -t
# Look for:
# system default destination: Demo_Printer
lp /etc/hosts
lp submits a job to the default destination unless
you override with -d. Printing a simple local file
is a fast sanity check.
# Expect a request id like:
# request id is Demo_Printer-42 (1 file(s))
lpq -P Demo_Printer
This is your “what is stuck right now” view. It helps confirm the job exists and whether it is active/pending.
# Expect something like:
# active lab 42 hosts ...
cancel Demo_Printer-42
Canceling by exact destination + job id prevents you from accidentally nuking an entire queue when you only meant to stop one job.
lpq -P Demo_Printer
Use remote access temporarily for troubleshooting and then revert. Leaving CUPS open remotely without access controls is unnecessary exposure.
sudo cupsctl --remote-admin --remote-any
This flips common server-side toggles via cupsctl.
Treat it as a controlled change: enable, test, then lock it back
down.
lpstat -t
/etc/cups/cupsd.conf /etc/cups/printers.conf
cupsd.conf controls daemon behavior and access rules.
printers.conf contains queue definitions and state.
http://localhost:631
Even if you manage CUPS primarily from the CLI, the web UI is the fastest way to print a test page and visually confirm queue state.
systemctl enable --now cups
: Enables and starts the CUPS scheduler service.
lpstat -t
: Full CUPS status summary (scheduler, default destination, printers).
cupsenable <queue>
: Enables a printer queue.
cupsaccept <queue>
: Allows the queue to accept jobs.
lpadmin -d <queue>
: Sets the system default destination.
lp <file>
: Submits a print job.
lpq -P <queue>
: Lists jobs for a specific destination.
cancel <queue>-<jobid>
: Cancels a specific job.
cupsctl --remote-admin --remote-any
: Enables remote admin and remote access (use intentionally; revert when done).
/etc/cups/cupsd.conf
: Main daemon configuration.
/etc/cups/printers.conf
: Queue definitions and printer state.
http://localhost:631
: Local CUPS web interface.