Airprint on Fedora 15

It is possible to AirPrint from your iPhone or iPad to your network attached (or USB) printer using Fedora 15 and CUPS. No additional software on your iPhone is needed, you just need to make sure Avahi, CUPS and your Firewall is configured properly.

First, make sure you have Avahi and CUPS installed. These are part of the default installation, so you should have some version of them installed.

bash$ rpm -q cups avahi

Additionally, If you are running Gnome3 and find that the System Settings -> Printers lacks some configuration options, use the Fedora system-config-printer tool from the command line to configure your printers. The Gnome3 interface under System Settings -> Printers will see the configurations you make with system-config-printer.

If you don’t have the packages you need installed, use YUM to install them:

bash$ sudo yum install cups avahi system-config-printer

If you had to install the packages, make sure that CUPS and Avahi are started and enabled to start on boot. Otherwise, skip this step.

bash$ for SERVICE in cups avahi; do
> /sbin/chkconfig $SERVICE on
> /sbin/service $SERVICE start
> done

First, you will need your printer to be installed and configured on the Fedora 15 system. Do this with System Settings -> Printers or system-config-printer. If your printer is already installed and working, skip this step.

bash$ sudo system-config-printer

Once your printer is installed and working, note it’s name in CUPS. For instance, my printer is called Epson.

bash$ lpstat -p
printer Epson is idle.  enabled since Sun 02 Oct 2011 08:20:54 PM EDT
                	Ready to print.

Next, you will need to configure your printer with Avahi (a system which facilitates service discovery on your local network). Do this by editing a new service file under /etc/avahi/services. In this example, I name the file printer.service, but any name will work.

bash$ sudo vim /etc/avahi/services/

Now, insert this XML into the file making sure to change ‘Epson’ to your printer name as listed in lpstat -p. Feel free to also change the options for your printer in the various <txt-record> entries.

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
            <txt-record>product=virtual Printer</txt-record>