Saturday, April 16, 2016

Printer in Arch Linux



Today, I try to install windows printer in my Arch Linux OS. However, it is to difficult for me. I tried a lot of things. Finally, the printer work now!

To make a windows printer working on the Linux, we need to set up samba. I follow the instruction on this website:

  • Set up Samba
    • install samba package  
    • yaourt -S samba
    • Copy the default configure file to smb.conf cp /etc/samba/smb.conf.default /etc/samba/smb.conf 
    • Edit /etc/samba/smb.conf, scroll down to the Share Definitions section. The default configuration automatically creates a share for each user's home directory. However, users cannot actually log in unless they add a users wildcard. 
    • /etc/samba/smb.conf
      ...
      [homes]
         comment = Home Directories
         browseable = no
         writable = yes
         valid users = %S
    • To provide basic file sharing through SMB start/enable smbd.service
    • After the configuration of samba, start/enable the smbd.service To check whether the samba is installed successfully, use the following command 
    • smbclient -L NTSVR6.cse.cuhk.edu.hk 
  • Install CUPS 
    • Install the cups, ghostscript, and gsfonts packages. 
    • If you intend to "print" into a PDF document, also install the cups-pdf package. By default, pdf files are stored in /var/spool/cups-pdf/$USER. The location can be changed in /etc/cups/cups-pdf.conf. 
    • Start and enable org.cups.cupsd.service. 
  • Install Driver 
    • I cannot find the HP LaserJet P2055dn in the list 
    • Install the package hplip
    • yaourt -S hplip 
    • After the installation of driver, we can find HP LaserJet P2055dn in the list now 
Now we can use the Printer Settings to add a new printer! However, the default server name is not NTSVR6 but NTSVR6.cse.cuhk.edu.hk. So we need to add smb://NTSVR6.cse.cuhk.edu.hk/lp120!