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.
lpstat.
-d
is supplied).
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 or pending.
# Expect something like:
# Demo_Printer is ready
# Rank Owner Job File(s) Total Size
# active lab 42 hosts ...
cancel Demo_Printer-42
Canceling by exact destination plus job id prevents you from canceling the wrong job or clearing more than you intended.
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 confirm queue state and print a test page.
If lpstat -t reports the scheduler is not running,
start and enable CUPS and re-check status.
A printer can exist but refuse work. Ensure the queue is enabled and accepting jobs before troubleshooting client behavior.
If there is no system default destination, printing without
specifying a queue can appear to “do nothing.” Set the default
with lpadmin -d.
Confirm the job exists with lpq -P, then cancel by
exact job id (queue-jobid) to avoid canceling the
wrong work.
If you enabled remote admin for troubleshooting, revert it when you are done to reduce exposure.
If you enabled remote admin for troubleshooting, revert to a local-only posture and confirm the queue is healthy.
lpstat -t
lpq -P Demo_Printer
# If you changed remote-access settings, revert intentionally (site policy may differ)
sudo cupsctl --no-remote-admin --no-remote-any
lpstat -t shows the scheduler running, the queue is
enabled and accepting jobs, and the job queue is not stuck.
systemctl enable --now cups
: Enables and starts the CUPS scheduler service.
enable
: Enables the service to start at boot.
--now
: Starts the service immediately.
lpstat -t
: Full CUPS status summary (scheduler, default destination, printers).
-t
: Displays the full status view.
cupsenable <queue>
: Enables a printer queue.
cupsaccept <queue>
: Allows the queue to accept jobs.
lpadmin -d <queue>
: Sets the system default destination.
-d
: Sets the default destination.
lp <file>
: Submits a print job to the default destination.
lpq -P <queue>
: Lists jobs for a specific destination.
-P
: Selects the destination (printer/queue).
cancel <queue>-<jobid>
: Cancels a specific job by destination and job id.
cupsctl --remote-admin --remote-any
: Enables remote admin and remote access (use intentionally; revert when done).
--remote-admin
: Allows remote administrative access.
--remote-any
: Allows remote access from any host.
cupsctl --no-remote-admin --no-remote-any
: Reverts remote admin and remote access toggles.
--no-remote-admin
: Disables remote administrative access.
--no-remote-any
: Disables remote access from any host.
/etc/cups/cupsd.conf
: Main daemon configuration.
/etc/cups/printers.conf
: Queue definitions and printer state.
http://localhost:631
: Local CUPS web interface.