Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for How to configure & take print on Linux?
5 Mins Learn
5 Mins Learn

Posted on • Edited on • Originally published at5minslearn.Medium

     

How to configure & take print on Linux?

4 Simple Steps to take print on your Linux (Ubuntu) machine

Modern printers manufactured nowadays comes with a compact disk (CD) to install the driver. But, most vendors provide support only for Windows machines. This means, the driver that comes with CD can be installed only on Windows machine.

In this article, let’s explore an easy way to configure a printer on your Linux machine and take a quick print out.

Before getting into the configuration steps, let’s understand about CUPS API.

CUPS API

CUPS stands forCommon Unix Printing System

From Source (https://github.com/apple/cups)

CUPS is a standards-based, open source printing system developed by Apple Inc. for macOS® and other UNIX®-like operating systems. CUPS uses the Internet Printing Protocol (“IPP”) and provides System V and Berkeley command-line interfaces, a web interface, and a C API to manage printers and print jobs. It supports printing to both local (parallel, serial, USB) and networked printers, and printers can be shared from one computer to another, even over the Internet!

CUPS was originally developed byMichael R Sweet atEasy Software Products starting in1997, with the first beta release onMay 14, 1999.Apple licensed CUPS for macOS in2002, and inFebruary 2007 Apple purchased CUPS and hired Michael to continue its development as an open source project.

In December 2019, Michael left Apple to startLakeside Robotics. In September 2020 he teamed up with the OpenPrinting developers to fork Apple CUPS to continue its development. TodayApple CUPS is the version of CUPS that is provided with macOS® and iOS® whileOpenPrinting CUPS is the version of CUPS being further developed by OpenPrinting for all operating systems.

So, CUPS was adopted by more than 99% of the modern printers. Almost all the printers released now supports CUPS API.

We need to install CUPS in our Linux machine. Let’s explore the 4 step process to setup and take print out.

Before proceeding, ensure you turned on your printer and connect it with your computer / laptop via USB

Configure CUPS on Linux Machine

Step 1 — Install CUPS

Install CUPS using a simple command from Snap Store

sudo snap install cups
Enter fullscreen modeExit fullscreen mode

This command will install the latest stable version of CUPS on your machine

Install CUPS from Snap Store

If you’re a debian based user and don’t wish to install CUPS via Snap store, download the latest CUPS release fromhttps://github.com/apple/cups/releases (*.tar.gz file) and install on your machine

Navigate tohttp://localhost:631/ on your browser to quickly verify your CUPS installtion. This will land you in home page of CUPS.

CUPS can be configured and monitored using a web interface, which by default is available athttp://localhost:631/admin . The web interface can be used to perform all printer management tasks.

CUPS Home Page

Step 2 — Find Available Printers

Find the available printers by running the following command

lpstat -p -d
Enter fullscreen modeExit fullscreen mode

This command will list the available printers connected with your computer both via USB and Network.

List printers connected with your computer

Step 3 — Setup default Printer

Select the printer you want to set default to and run the following command (In my case it isHLB2000D)

lpoptions -d HLB2000D
Enter fullscreen modeExit fullscreen mode

This command will set the mentioned printer (HLB2000D) as default printer. All your future print requests will be sent to this printer unless you explicitly mention a different printer.

Set a default printer

All the configuration steps are done. Let’s take a print out

Step 4 — Take a Print

Navigate to the folder (use cd command) where you have your PDF of Image files via terminal and run the following command to take print.

lp sample.pdf
Enter fullscreen modeExit fullscreen mode

Enter your file name next to lp command to take print of the file. In my case, it’s **sample.pdf **file.

Command to take print

My Print job is done and I got the print of my files.

Print of my file (P. S. Ignore the shadow on the paper)

That’s all. Your laptop is configured with the printer. Use the lp command or print button to take print from next time.

Subscribe to ournewsletter to receive more such insightful articles that get delivered straight to your inbox.

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Learn concepts under 5 minutes
  • Joined

More from5 Mins Learn

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp