Posted on Leave a comment

ArchLinux Printing with CUPS

#!/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

Posted on Leave a comment

How to Update the Pacman Databases on Arch Linux

Every Linux distribution has a package repository where precompiled packages are kept. Of course you can download and install these packages manually, but that is sometimes time consuming or nearly impossible. Because each Linux packages has some dependencies, that is they depend on some other packages, which in order depends on some other ones and so on. So a tool called package manager was created to automatically download and install packages along with their dependencies.