CUPS (Polski)

From ArchWiki
Jump to navigation Jump to search





Notes: please use the first argument of the template to provide more detailed indications. (Discuss in Talk:CUPS (Polski)#)

Instalacja wymaganych pakietów

Na początek zainstalujmy podstawowe pakiety:

# pacman -S cups ghostscript gsfonts

Dodajmy także cups do sekcji DAEMONS w Template:Filename.

Instalacja sterownika drukarki

Wybierz odpowiedni sterownik do swojej drukarki:

  • gutenprint - sterowniki do drukarek Canon, Epson, Lexmark, Sony, Olympus.
  • hplip - sterowki do drukarek firmy HP.
  • splix - sterowki do drukarek firmy Samsung.
  • cups-pdf - pakiet, który pozwala na konfigurację wirtualnej drukarki PDF tworzącej dokumenty o tym właśnie formacie.

W przypadku, drukarka nie pomimo zainstalowanych wymaganych pakietów,spróbuj zainstalować wszystkie sterowniki. Zdarzają się bowiem takie sytuacje, że drukarki mogą działać na innych sterownikach. Na przykład do prawidłowego działania drukarki Brother HL-2140 wymagany jest pakiet hplip.


Teraz, kiedy już masz zainstalowane podstawowe pakiety do obsługi drukarki, możesz przejść do etapu jej konfiguracji. W środowiskach graficznych, takich jak Gnome czy KDE, znajdziesz przydatne programy, które mogą pomóc w zarządzania drukarką. Jako, że nie wszyscy używają tych środowisk, poniższa konfiguracja koncentruje sie na zastosowaniach dostarczonych przez interfejs sieciowy CUPS.

Jeżeli planujesz udostępnić drukarkę sieciowej lub podłączyć się do takiej, zapoznaj sie z artykułem CUPS printer sharing (w języku angielskim).

USB printer users may need to blacklist the Template:Codeline module. Keep in mind that there seems to be a lot of uncertainty regarding blacklisting Template:Codeline, as some USB printers, including some Canon and Epson printer series, are not recognized without it. To disable the module, edit Template:Filename as shown:


Custom kernel users may need to manually load the Template:Codeline module before proceeding:

# modprobe usbcore


# tail /var/log/messages.log


# dmesg

If you're using Template:Codeline, the output should indicate that the printer has been detected like so:


If you blacklisted Template:Codeline, you will see something like:

usb 3-2: configuration #1 chosen from 1 choice

Parallel port printers

If planning on using a parallel port printer, note that the configuration is pretty much the same, except for the modules:

# modprobe lp
# modprobe parport
# modprobe parport_pc

Once again, check the setup by running:

# tail /var/log/messages.log

It should display something like this:

lp0: using parport0 (polling).


It's convenient to have the system automatically load the kernel module every time the it starts up. To do so, use a text editor to open up Template:Filename and add the appropriate module to the MODULES=() line. Here is an example:


CUPS daemon

With the kernel modules installed, the system is now ready to start the actual CUPS daemon. To do this, simply run this command:

# /etc/rc.d/cups start

For automatically starting CUPS every time the system is powered on, add it to the DAEMONS=() line in the Template:Filename file. For example:


Web interface and tool-kit


From here, follow the various wizards to add the printer. A usual procedure is to start by clicking on Adding Printers and Classes and then Add Printer. When prompted for a user-name and password, log in as root. The name assigned to the printer does not matter, the same applies for 'location' and 'description'. Next, a list of devices to select from will be presented. The actual name of the printer shows up next to the label ( e.g., next to USB Printer #1 for USB printers). Finally, chose the appropriate drivers and the configuration is complete.


Tip: GNOME users may be inclined towards installing the GNOME CUPS manager GUI frontend. See: #Alternative CUPS interfaces

CUPS administration

A user-name and password will be required when administrating the printer in the web interface, such as: adding or removing printers, stopping print tasks, etc. The default user-name is the one assigned in the sys group, or root (change this by editing Template:Filename in the line of SystemGroup).

If the root account has been locked, it is not possible to log in the CUPS administration interface with the default user-name and password. In this case, it may be needed to change the default SystemGroup in cupsd.conf and read this post.

Remote access to web interface

By default, the CUPS web interface can only be accessed by the localhost; i.e. the computer that it is installed on. To remotely access the interface, make the following changes to the Template:Filename file. Replace the line:

Listen localhost:631


port 631

so that CUPS listens to incoming requests.

There are three levels of access that can be granted:

<Location />           #access to the server
<Location /admin>	#access to the admin pages
<Location /admin/conf>	#access to configuration files

To give remote hosts access to one of these levels, add an Template:Codeline statement to that level's section. An Template:Codeline statement can take one or more of the forms listed below:

Allow all
Allow *
Allow ip-address
Allow ip-address/netmask

Deny statements can also be used. For example, if wanting to give all hosts on the subnet full access, file Template:Filename would include this:

# Restrict access to the server...
# By default only localhost connections are possible
<Location />
   Order allow,deny
   Allow From localhost
   Allow From

# Restrict access to the admin pages...
<Location /admin>
   # Encryption disabled by default
   #Encryption Required
   Order allow,deny
   Allow From localhost
   Allow From

# Restrict access to configuration files...
<Location /admin/conf>
   AuthType Basic
   Require user @SYSTEM
   Order allow,deny
   Allow From localhost
   Allow From


The best way to get printing working is to set 'LogLevel' in Template:Filename to:

LogLevel debug

And then viewing the output from Template:Filename like this:


The characters at the left of the output stand for:

  • D=Debug
  • E=Error
  • I=Information
  • And so on

These files may also prove useful:



Print a document and watch Template:Filename to get a more detailed and correct image of the printing process.

Problems resulting from upgrades


CUPS stops working




and restart CUPS to employ the new settings.

Error with gnutls

If receiving errors such as:


gnutls may be in need of updating:

# pacman -S gnutls

After updating, there may be a file named Template:Filename in Template:Filename. This is the unmodified original configuration file that has been placed as part of the update. Compare it with the currently installed version and adjust to preference.

All jobs are "stopped"



The PPD version is not compatible with gutenprint


# /usr/sbin/cups-genppdupdate


USB printers under CUPS 1.4.x

New CUPS 1.4.x introduces many changes:

Configuration file


Blacklisting usblp

CUPS now uses libusb and printer USB devices (under /dev/bus/usb/) instead of the usblp generated /dev/usb/lpX ones. In order to get USB printers working, the usblp module needs disabling. This can be done by blacklisting it in /etc/rc.conf, or by adding "blacklist usblp" to a configuration file in /etc/modprobe.d. Some users have also reported that they needed to reinstall their printer.

Device node permissions




# the ones from the old usblp kernel module


Device node permission troubleshooting

Get the printer's device file and its permissions with:

$ lsusb


cat /etc/udev/rules.d/10-usbprinter.rules

Note that idVendor and idProduct are from the lsusb listing above.

Loading firmware



CUPS permission errors
  • Sometimes, the block device has wrong permissions:
# ls /dev/usb/
# chgrp lp /dev/usb/lp0


Make sure dbus is installed and running, e.g. check DAEMONS in Template:Filename or run Template:Codeline.


If running hp-toolbox as a regular user results in:

# hp-toolbox

or, "Template:Codeline", then it may be needed to add the user to the lp group by running the following command:

# gpasswd -a <username> lp


If receiving any of the following error messages in Template:Filename while using a HP printer, with jobs appearing to be processed while they all end up not being completed with their status set to 'stopped':





# pacman -S hplip

Printing fails with unauthorised error

If the user has been added to the lp group, and allowed to print (set in Template:Filename), then the problem lies in Template:Filename. This line could be the culprit:

AuthInfoRequired negotiate

Comment it out and restart CUPS.

Print button greyed-out in GNOME print dialogs

Source: I can't print from gnome applications. - Arch Forums

Be sure the package: libgnomeprint is installed

Edit Template:Filename and add

# HostNameLookups Double

Restart CUPS:

# /etc/rc.d/cups restart

CUPS fails to print with 'Unable to open device "hal:///[...]": Permission denied'

The permissions on some files are wrong:

# cd /usr/lib/cups/backend
# chmod 700 hal # (previously 755)
# chmod 700 usb # (previously 755)

Unknown supported format: application/postscript

Comment the lines:

application/octet-stream        application/vnd.cups-raw        0      -

from Template:Filename, and:


in Template:Filename.

Finding URIs for Windows Print Servers


$ smbtree -U windowsusername


		\\REGULATOR-PC\print$         	Printer Drivers





Alternative CUPS interfaces


# pacman -S system-config-printer-gnome


  • 1. Create group, and add a user
# groupadd lpadmin
# usermod -aG lpadmin <username>
SystemGroup sys root <insert here>
# /etc/rc.d/cups restart


There is also gtklp:

# pacman -S gtklp

PDF virtual printer



This package can be installed by the following command:

# pacman -S cups-pdf


Print to postscript: CUPS-PDF virtual printer trick


Configuring CUPS-PDF virtual printer

1. Install cups & cups-pdf from extra.

2. Start cups with:

# /etc/rc.d/cups 
Note: Add 'cups' to the deamons line in /etc/rc.conf to start automatically at boot.


Administration -> Add Printer
Make:	Generic
Driver:	Generic CUPS-PDF Printer


Another source for printer drivers
