Skip to content

Instantly share code, notes, and snippets.

@notdodo
Last active February 7, 2024 09:07
Show Gist options
  • Star 28 You must be signed in to star a gist
  • Fork 12 You must be signed in to fork a gist
  • Save notdodo/660a2a67b9bc8a815ba537530137636a to your computer and use it in GitHub Desktop.
Save notdodo/660a2a67b9bc8a815ba537530137636a to your computer and use it in GitHub Desktop.
Install a printer on Arch Linux with cups using command line
#!/bin/bash
################################################################
# Install a printer on Arch Linux with cups using command line #
# Used for a HP PSC 1510 with default driver #
################################################################
sudo pacman -S cups
sudo systemctl start org.cups.cupsd
sudo systemctl status -l org.cups.cupsd
# If errors are shown add yourself to 'lp' group
sudo gpasswd -a ${USER} lp
sudo systemctl restart org.cups.cupsd
sudo systemctl status -l org.cups.cupsd
# If errors are shown again add yourself to 'lpadmin' group
sudo gpasswd -a ${USER} lpadmin
sudo systemctl restart org.cups.cupsd
# Find if your device is connected and found by the system
lsusb
# Find the URI
sudo lpinfo -v #
# Find if a driver for your device is installed
lpinfo -m
# Create a print queue with URI and driver
sudo lpadmin -p HP_PSC_1510 -E -v "usb://HP/PSC%201500%20series?serial=MY61DD31P90498&interface=1" -m drv:///sample.drv/deskjet.ppd
# Set as default
lpoptions -d HP_PSC_1510
# Set A4 Page
lpoptions -p HP_PSC_1510 -o PageSize=A4
# Enable printing
sudo cupsenable HP_PSC_1510
sudo cupsaccept HP_PSC_1510
# Restart!!
sudo systemctl restart org.cups.cupsd
# Test printer
lpr test.txt
# List other options
lpoptions -p HP_PSC_1510 -l
@MatthewCushing
Copy link

MatthewCushing commented Dec 7, 2018

THANK YOU!!!!!!!!!!!!!!!!!!
Why was this so hard to figure out? lmao

Thank you google for your amazing google search that brought me to this random github submission and thank you edoz90 for writing this. I have a small feeling this was for yourself xD. If it was, be happy you helped someone else out

@aripapage
Copy link

I had to download and install SAMSUNG drivers from the AUR and then followed your guide! Works like a charm! Thank you!

@abdolaab
Copy link

Thanks a lot, I even didn't know if the driver was installed, I am using Sumsung M2020.

@shwaybotx
Copy link

There is a small error on line 43.
sudo cupaccept HP_PSC_1510 is incorrect.
It should read:
sudo cupsaccept HP_PSC_1510

@notdodo
Copy link
Author

notdodo commented Jul 15, 2019

Thank you @shwaybotx. It's fixed now

@shwaybotx
Copy link

shwaybotx commented Jul 15, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment