SliTaz GNU/Linux official and community documentation wiki.
.png

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:guides:printer [2010/07/13 21:05]
linea add link (thanks Darjeeling)
en:guides:printer [2010/10/15 19:22] (current)
linea add usb printer (fr translation)
Line 1: Line 1:
 ====== Printing ====== ====== Printing ======
 +
 +The CUPS (Common Unix Printing System) software manages printers connected to the local computer or over a network. The local printers are attached via a loop-back connection (IP 127.0.0.1), a network connection pointing to the same system.
  
 ===== Installing a Network Printer ===== ===== Installing a Network Printer =====
  
-Do as root in xterm:+Install CUPS and add the user(s) to the //lp// group to gain permissions to access the devices. This can be done as root in a terminal:
  
 <​code>​ <​code>​
Line 10: Line 12:
 </​code>​ </​code>​
  
-Change some lines in /​etc/​cupsd.conf ​(# leafpad /​etc/​cupsd.conf):+Again as root, customise the default configuration ​in /​etc/​cupsd.conf:​
  
-<code>+<file>
 # Administrator user group... # Administrator user group...
 SystemGroup lp SystemGroup lp
Line 29: Line 31:
   Deny From None   Deny From None
   Allow From 127.0.0.1   Allow From 127.0.0.1
-</code>  ​+</file>  ​
  
-Set the admin password for cups:+Set the administrative ​password for CUPS and add an administrative user:
  
 <​code>​ <​code>​
Line 37: Line 39:
 </​code>​ </​code>​
  
-Now you should be able to have access to administration ​in cups with your browser ​with http://​localhost:​631/​+You should ​now be able to have access to the CUPS administration ​through ​your browser ​by entering the address ''<​nowiki>​http://​localhost:​631/​</​nowiki>''​
  
-Now you have to install ​the printer drivers:+Install ​the printer drivers ​with the following packages:
  
-    - hplip : for hp printers +    - hplip : for HP printers 
-    - gutenprint : for canonepson, Lexmark, Sony, Olympus+    - gutenprint : for CanonEpson, Lexmark, Sony, Olympus
     - foomatic-db,​ foomatic-db-engine,​ foomatic-db-nonfree and foomatic-filters : several free software printer drivers     - foomatic-db,​ foomatic-db-engine,​ foomatic-db-nonfree and foomatic-filters : several free software printer drivers
-    - ufr2: for canon printers (extra drivers) +    - ufr2: for Canon printers (extra drivers) 
-    - splix: for samsung +    - splix: for Samsung 
-    - cups-pdf: for pdf printing+    - cups-pdf: for "printing" to PDF files
  
 +For example, install the HP printer drivers with the following //root// command
 <​code>​ <​code>​
-eg: # tazpkg get-install hplip+# tazpkg get-install hplip
 </​code>​ </​code>​
  
Line 57: Line 60:
 and add the address socket//​192.168.2.1:​9100</​nowiki>​ and add the address socket//​192.168.2.1:​9100</​nowiki>​
  
-If you get the errorReturning IPP client-error-document-format-not-supported for Print-Job in /​var/​log/​cups/​error.logthen you have to add two files to /etc/cups+If you get the error, "//Returning IPP client-error-document-format-not-supported for Print-Job in /​var/​log/​cups/​error.log//" ​then add two files to the /​etc/​cups ​directory. The easiest method is to start a text editor such as Leafpad from a root terminal; start the Terminal and switch to the root user.
  
-First with the name: mime.convs (# leafpad ​/​etc/​cups/​mime.convs):​ +  * ''​mime.convs'' ​(/​etc/​cups/​mime.convs):​ 
-<code>+<file>
 application/​pdf application/​postscript 33 pdftops application/​pdf application/​postscript 33 pdftops
 application/​postscript application/​vnd.cups-postscript 66 pstops application/​postscript application/​vnd.cups-postscript 66 pstops
Line 102: Line 105:
  
 application/​vnd.cups-postscript application/​vnd.cups-raster 100 pstoraster application/​vnd.cups-postscript application/​vnd.cups-raster 100 pstoraster
-</code>+</file>
  
-and second file with the name: mime.types (# leafpad ​/​etc/​cups/​mime.types):​+  * ''​mime.types'' ​(/​etc/​cups/​mime.types):​
  
-<code>+<file>
 application/​pdf pdf string(0,​%PDF) application/​pdf pdf string(0,​%PDF)
 application/​postscript ai eps ps string(0,​%!) string(0,<​04>​%!) \ application/​postscript ai eps ps string(0,​%!) string(0,<​04>​%!) \
Line 210: Line 213:
  
 application/​octet-stream application/​octet-stream
 +</​file>​
 +
 +<note tip>If at the end of the procedures the printer is not working, restarting the service or computer may help.</​note>​
 +
 +===== Installing an USB Brother HL 2030 Printer =====
 +
 +To install cups, hal-cups-utils,​ usbutils. As root, type:
 +
 +<​code>​
 +root@slitaz:#​ tazpkg get-install cups
 +root@slitaz:#​ tazpkg get-install hal-cups-utils
 +root@slitaz:#​ tazpkg get-install usbutils
 </​code>​ </​code>​
  
-===== Installing a HP printer ​=====+Cups is used to manage the printer, hal-cups-utils allows cups to use HAL for printer connections and usbutils gives us the lsusb utility which lets us know how the printer is connected.
  
-This is for a clean installation of SliTaz GNU/Linux cooking-20100314+Now we can add tux to the lp (printer) group. As root, we do: 
 + 
 +<​code>​ 
 +root@slitaz:#​ addgroup tux lp 
 +</​code>​ 
 + 
 +For the web interface of cups to be properly activated, we still need to change a few things in the ///​etc/​cupsd.conf//​ file: 
 + 
 +<​code>​ 
 +root@slitaz:#​ leafpad /​etc/​cups/​cupsd.conf 
 +</​code>​ 
 + 
 + <​file>​ 
 +   # Administrator user group... 
 +   ​SystemGroup lp 
 +    
 +   # Restrict access to the admin pages... 
 +    
 +   Order allow,​deny 
 +   Allow 127.0.0.1 
 +    
 +    
 +   # Restrict access to configuration files... 
 +    
 +   ​AuthType Default 
 +   ​Require user @SYSTEM 
 +   Order allow,​deny 
 +   Deny From None 
 +   Allow From 127.0.0.1 
 + </​file>​ 
 + 
 +To modify permissions on the printer you need to know the details of the bus and device. For this, we do as root: 
 + 
 +<​code>​ 
 +root@slitaz:#​ lsusb 
 +</​code>​ 
 + 
 +And get the following output: 
 + 
 +<​code>​ 
 +   Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub 
 +   Bus 001 Device 002: ID 04f9:0027 Brother Industries, Ltd HL-2030 Laser Printer 
 +</​code>​ 
 + 
 +You can now change the permissions on the associated file: 
 + 
 +<​code>​ 
 +root@slitaz:#​ chmod 666 /​dev/​bus/​usb/​001/​002 
 +</​code>​ 
 + 
 +And then start cups: 
 + 
 +<​code>​ 
 +root@slitaz:#​ /​etc/​init.d/​cupsd start 
 +</​code>​ 
 + 
 +We can now configure the printer and fetch the openprinting ppd file for that printer  
 +model: http://​www.openprinting.org/​printer/​Brother/​Brother-HL-2030 and also add the following  
 +packages: foomatic-filters foomatic-db foomatic-db-engine:​ 
 + 
 +<​code>​ 
 +root@slitaz:#​ tazpkg get-install foomatic-filters 
 +root@slitaz:#​ tazpkg get-install foomatic-db 
 +root@slitaz:#​ tazpkg get-install foomatic-db-engine 
 +</​code>​ 
 + 
 +Now we can restart cups and point midori to http://​localhost:​631 
 + 
 +Cups then asks for: 
 + 
 +- The login "​root"​ (default tux) 
 + 
 +- The corresponding password. 
 + 
 +Then navigate to > Printers > Add Printer > click on the printer name that you recognize and do not forget to indicate the path in the connection box: ///​dev/​bus/​usb/​001/​002//​ (in my case). 
 + 
 +Then go to the web interface of cups ppd and install the new printer using the file Brother HL-2030-hl1250.ppd located in the user's account. Now you can automatically restart cupsd each time you start the system by using System Tools (in the menu) -> Control box -> Initialization and allow the cupsd daemon to run by adding it to the 'Run daemons'​ section:  
 + 
 +<​file>​ 
 +dbus hald firewall slim cupsd 
 +</​file>​  
 + 
 +===== Installing a HP Printer ===== 
 + 
 +<​note>​This is for a clean installation of SliTaz GNU/Linux cooking-20100314</​note>​
  
   - With the printer plugged in and powered on, run <​code>​   - With the printer plugged in and powered on, run <​code>​
-su root +su root 
-tazpkg recharge +tazpkg recharge 
-tazhw setup printer</​code>​+tazhw setup printer</​code>​
   - Install only hplip and hal-cups-utils   - Install only hplip and hal-cups-utils
   - The printer should show up in the list of printers displayed as part of this command. It will then attempt to open the CUPS admin pages in Midori (at http://​localhost:​631 )   - The printer should show up in the list of printers displayed as part of this command. It will then attempt to open the CUPS admin pages in Midori (at http://​localhost:​631 )
   - On my system, the printer does not show up in the browser under 'Find printers'​ and I get a '​Forbidden'​ error when trying to add a printer via the browser   - On my system, the printer does not show up in the browser under 'Find printers'​ and I get a '​Forbidden'​ error when trying to add a printer via the browser
-  - Instead, run <​code>​hp-setup</​code>​ and follow the instructions. The test page should print correctly. The printer should also show up in the list of printers in applications (like the text editor) and will also appear in the list of printers on the CUPS browser pages, although in my case it is still not possible to make any changes to it +  - Instead, run <​code>​hp-setup</​code>​ and follow the instructions. The test page should print correctly. The printer should also show up in the list of printers in applications (like the text editor) and will also appear in the list of printers on the CUPS browser pages, although in my case it is still not possible to make any changes to it
- +
  
 ===== Installing a HP All-In-One Printer/​Scanner ===== ===== Installing a HP All-In-One Printer/​Scanner =====
Line 254: Line 351:
 If your scanner does not show up immediately,​ enter for none in my set-up; now the scanner device should be listed in purple text, e.g.: If your scanner does not show up immediately,​ enter for none in my set-up; now the scanner device should be listed in purple text, e.g.:
  
-<code>/​dev/​bus/​usb/​004/​002</​code>+<file>/​dev/​bus/​usb/​004/​002</​file>
  
 === Verify Permissions === === Verify Permissions ===
Line 260: Line 357:
 Your scanner must be in scanner group with 666 permissions Your scanner must be in scanner group with 666 permissions
  
-<​code>​ crw-rw-rw- ​   1 root     ​scanner ​ 189, 385 Jun 22 19:44 /​dev/​bus/​usb/​0 </​code>​+<​code>​crw-rw-rw- ​   1 root     ​scanner ​ 189, 385 Jun 22 19:44 /​dev/​bus/​usb/​0 </​code>​
  
 Reply y to start scanner Reply y to start scanner
Line 271: Line 368:
 The //tux// user is automatically added to scanner group, so tux may scan, but if you run under another user name that user can't scan until you add them to //scanner// group. Do this with the command (as //root//): The //tux// user is automatically added to scanner group, so tux may scan, but if you run under another user name that user can't scan until you add them to //scanner// group. Do this with the command (as //root//):
  
-<​code>​addgroup //​username//​ scanner</​code>​+<​code>​addgroup //​username//​ scanner</​code>​
  
 ===== Links ==== ===== Links ====
Line 279: Line 376:
 ===== TODO ===== ===== TODO =====
  
-    * USB Printer 
     * Parallel Printer     * Parallel Printer
  
 
en/guides/printer.1279047930.txt.gz · Last modified: 2010/07/13 21:05 by linea