Setting up printing in Gentoo Linux is relatively easy, as all of the packages required can be found in the portage tree as of 8 August 2002. All that we have to do is configure the actual printer and make sure that it interprets Postscript correctly. The first step is installing the necessary software.
#emerge net-print/cups #emerge gnome-base/gnome-print #emerge gnome-base/libgnomeprint #emerge media-gfx/gimp-print #emerge net-print/gimp-print-cups
Since the packages are now installed with their appropriate dependencies, it is time to install the printer itself.
Unless you already have USB printer support compiled into the kernel, it will have to be compiled in. You need to have USB core support and USB printer support enabled either as modules or built in. I chose to modularize both because I can
Now that the appropriate kernel options are installed, it is time to see if the printer is detected and dealt with appropriately. Once everything is restarted, load the printer modules.
#insmod usbcore #insmod printer
After the modules have loaded successfully, plug in the printer, and check
#tail /var/log/messages
You should see something like this:
hub.c: USB new device connect on bus2/2, assigned device number 2 printer.c: usblp0: USB bidirectional printer dev 2 if 0 alt 1 proto 2 vid 0x03F0 pid 0x1104
Before setting up the printer using CUPS, it is possible to test your printer using cat.
#touch test.txt #echo "Hello World" > test.txt #cat test.txt > /dev/usb/lp0 Alternatively, for parallel port printers: #cat test.txt > /dev/lp0
Now it is time to configure the printer and CUPS. If you are using an HP Inkjet printer, it is necessary to install the
#emerge net-print/hpijs
In order for your printer to interpret Postscipt correctly, CUPS needs a PPD (Printer Postscript Definition) file. The easiest way to generate a PPD is through foomatic. The foomatic configuration scripts are available
#foomatic-configure -s cups -p printer ID -c print_device -n queue name -d hpijs #mv /etc/foomatic/your.new.ppd /etc/cups/ppd
Since the printer itself is now configured, now CUPS must be setup to handle the printer queueing. CUPS can be accessed via web browser on port 631 of the printer machine, which makes it very handy.
#rc-update add cupsd default #/etc/init.d/cupsd start
The CUPS daemon should now be running, so open up your favorite browser and point it to
First, let's setup The GIMP, just because it is cool and worth it. Open up The GIMP, and open an existing picture, or just some blank pic, it really doesn't matter because all we are looking for is the File menu. RIght click on the image and go to File/Print The dialog for printing should come up, and when it does, click on new printer. If your printer is not already listed, type in the name of your printer, then select your printer type. Ok, you are now setup to print from The GIMP. Play with the settings and have some fun.
Printing with OpenOffice.org1.0 is not much more difficult. Goto
TODO: add Abiword support.
Local printing is now complete, now to add network support.
First, SAMBA has to be installed for the next two network printing options to work.
#emerge net-fs/samba
First, we use foomatic to generate the PPD for the remote printer. Don't forget to check if your printer is compatible with Linux or not at the
#foomatic-configure -s cups -p printer ID -c smb://user:password@server/share -n queue name -d hpijs #mv /etc/foomatic/your.new.ppd /etc/cups/ppd
Now, point your favorite web browser
Linux makes a great print server, then again, it makes a great everything server. The first thing to do is edit
[global] workgroup = YOUR_WORKGROUP server string = Gentoo Linux Server encrypt passwords = True security = user smb passwd file = /etc/samba/private/smbpasswd log file = /var/log/samba/log.%m socket options = IPTOS_LOWDELAY TCP_NODELAY domain master = Yes local master = Yes preferred master = Yes os level = 65 dns proxy = No name resolve order = lmhosts host bcast bind interfaces only = True interfaces = eth0 hosts deny = ALL hosts allow = 192.168.1.4 127.0.0.1 (list of allow hosts here) debug level = 1 create mask = 0644 directory mask = 0755 level2 oplocks = True read raw = no write cache size = 262144 [printers] comment = All Printer path = /var/spool/samba browseable = no
Now that the SAMBA is configured, restart samba, go to your Windows machine and install a network printer. Piece of cake, eh?