新增印表機
桌面版Linux系統在印表機的設定, 已經非常人性化, 只要印表機一接上, 系統就會自動抓到. 甚至是網路印表機也不需設定.
Server 版Linux則比較麻煩, 還好出現了cups ( Common Unix Printing System)這個套件幫我們設定. 這個套件除了可以幫Linux新增USB及網路印表機之外, 還可以把這個新增的印表機又設定成網路共享印表機. 當然啦, 如果你的印表機本身就是接網路線的話, 就無需再透過 Linux 轉發成無線印表機了.
Server版 Linux 及 Raspbian 都必需先安裝 cups, 請按照如下操作
sudo apt-get install cups #安裝CUPS sudo usermod -a -G lpadmin pi #假設正使用預設pi帳號登入 sudo vim /etc/cups/cupsd.conf 然後新增如下藍色的部份 # Only listen for connections from the local machine # Only listen for connections from the local machine # Listen localhost:631 Port 631 <Location / > # Restrict access to the server... Order allow,deny Allow @local </Location > <Location /admin > # Restrict access to the admin pages... Order allow,deny Allow @local </Location > <Location /admin/conf > AuthType Default Require user @SYSTEM Order allow,deny Allow @local </Location >
接著重啟服務
sudo /etc/init.d/cups restart
然後於瀏覽器輸入 http://localhost:631, 再進入Administration, 選取 Add Printer, 就可以看到網路印表機了. 設定好就可以直接列印
列印指令
lpr套件可以管理列印的啟動及查詢, 所以需先安裝此套件
