HP Printing using the hplip Package in openSUSE

HP-TOOLBOX is used to Work With Already Installed HP Printers:


Introduction to the hplip Package:**

If you own an HP printer(s), you are lucky in my opinion. While not all HP printers are gems, most all of them will work like a champ using the Package hplip, installed by default in openSUSE. And you will most likely later be able to find an ink or laser cartridge for it when you need it. It is very true printer manufacturers sell printers cheep which often come with very little ink in the box and that cartridges are priced high where they make all of their money. This article is not going to correct how the printer manufacturers make their money. However, If you are looking to buy a printer that works with Linux and openSUSE, HP has got to be on your short list.

The Package hplip, now at version 3.12.11 in openSUSE 12.3, includes the following application files (and much more in documentation):


Most of these application files are actually run for you from the HP-TOOLBOX application once your printer has been installed.

**SETUP and INSTALL a New Printer:

  1. Now if you have an HP printer, you must use the hp-setup program to install it. Further, you must install the application as root to get it to work. Two quick commands for this to work are:
For KDE: Alt-F2 and **kdesu /usr/bin/hp-setup**


For Gnome: Alt-F2 and **gnomesu /usr/bin/hp-setup**
  1. If you would like to have an HP-SETUP icon on your desktop and in your Applications menu, copy the following line, paste it into terminal and press enter:
rm ~/bin/hp-icon ; wget -nc http://paste.opensuse.org/view/download/9430700 -O ~/bin/hp-icon ; chmod +x ~/bin/hp-icon ; hp-icon 

You should then end up with this in your desktop folder you can run which will request the root user password and should work on all desktops that come with openSUSE:

Let me say up front that in general, hp applications should NOT BE RUN AS ROOT! Root authoroty will be requested when required. For some reason, this does not work out properly for the hp-setup program which is why we need a special exception here for us to use.

  1. You may wish to install all required applications to allow the hplip application set to work. This is not done by default. If you intend on installing the very latest version of hplip, you MUST perform the following command function. Open up a terminal session and copy the following commands, paste it into a terminal session and press enter on each:
su -c "zypper refresh"


su -c "zypper --non-interactive --no-gpg-checks in --auto-agree-with-licenses cups cups-client cupsddk cups-devel dbus-1-devel python-gobject2 gcc-c++ ghostscript-library openssl libjpeg-devel net-snmp-devel glibc libtool libgphoto2-devel libusb-1_0-devel libusb-1_0-0 make wget python-imaging python-qt4 dbus-1-python-devel dbus-1-python python-devel python-xml libpython2_7-1_0 python-notify python xsane sane-backends-devel sane-backends"

Enter the root user password if requested to allow the listed applications to be installed. You may wish to log out and back into openSUSE for some the installed applications to take effect.
IN ALL CASES** you will want to add yourself to the sys and lp user groups and you will want to open two ports in the openSUSE Firewall:

  1. Add yourself to the sys and lp user groups. Enter command in terminal. You must log out and back in for this to work:
su -c "/usr/sbin/usermod -a -G sys,lp $USER"
  1. Open up the Firewall ports using the following bash script, save as the file $HOME/bin/hp-firewall:
#! /bin/bash


grep ^FW_SERVICES_ACCEPT_EXT $conffile | grep -q "0/0,udp,,5353"
if  $? -ne 0 ]; then
    sed -i 's/^FW_SERVICES_ACCEPT_EXT="\(.*\)"/FW_SERVICES_ACCEPT_EXT="0\/0,udp,,5353 \1"/' $conffile

grep ^FW_SERVICES_ACCEPT_EXT $conffile | grep -q "0/0,udp,,427"
if  $? -ne 0 ]; then
    sed -i 's/^FW_SERVICES_ACCEPT_EXT="\(.*\)"/FW_SERVICES_ACCEPT_EXT="0\/0,udp,,427 \1"/' $conffile

systemctl stop SuSEfirewall2.service
systemctl start SuSEfirewall2.service

exit 0

The script must be marked executable to work. In terminal you use this command:

chmod +x $HOME/bin/hp-firewall

Then open up terminal and run the command to apply the firewall modifications. You would only need to run this one time:

sudo hp-firewall

CHECK and REPAIR your hplip Installation:

You may wish to check your installation to make sure it is setup correctly. Open up terminal and run the following command:

/usr/bin/hp-check -t

If any problems are found, use the following command to fix them:


For information on how to use the hplip allplications, an HTML file is installed by default. Open up your default web browser and paste in the following command:


You can also pop up the CUPS printing control from your Web Browser with the following URL:


INSTALL the Latest Version of hplip:

For anyone who wants to install or compile any C or C++ source files, you should take the following steps first:

Open YaST / Software / Software Management - Select the View Button on the top left and pick Patterns. Now, you will see several Patterns listed and you want to select:


[X] Base Development
[X] Linux Kernel Development
[X] C/C++ Development

Then Press the Accept button on the bottom right and allow these applications to install.

If you then feel you need to install the very latest version of the hplip application, here is what you do, all examples here assume version 3.13.7 for the names to work out right. In general, if you stick with the default hplip application version installed by openSUSE, you will avoid some problems I mention below:

  1. Get the latest Version of the Application (3.13.7): Download HP Linux Imaging and Printing from SourceForge.net, (Download to $HOME/Downloads)

  2. Open Up Terminal and change to the Downloads folder:

cd $HOME/Downloads
  1. Uncompress the Tarball:
tar xvfz hplip-3.13.7.tar.gz
  1. Change to the newly create folder:
cd hplip-3.13.7
  1. Configure the Source Files
./configure --with-hpppddir=/usr/share/cups/model/HP --prefix=/usr --enable-qt4 --disable-libusb01_build --enable-doc-build --disable-cups-ppd-install --disable-foomatic-drv-install --disable-foomatic-ppd-install --disable-hpijs-install --disable-udev_sysfs_rules --disable-policykit --enable-cups-drv-install --enable-hpcups-install --enable-network-build --enable-dbus-build --enable-scan-build --enable-fax-build
  1. Run Make on the files:
  1. Install as root
su -c "make install"

When you compile and install your own copy of hplip outside of using YaST and you do not use an RPM installation file, YaST does not know it has been installed. You can check to see if you have the latest application by starting the HP-TOOLBOX and then using the File / About command to see your present running version. You might need to log out and back into openSUSE after such an update from YaST to see that this has happened to you:

To prevent an update from YaST to hplip, do the following:

YaST / Enter Root User Password / Software / Software Management / enter and search for hplip / right click on each file and select Protected and the use the Accept button on the bottom right:

If you have already replaced the file from an update, but you have not removed the compile folder for the new copy of hplip, you need only change to the folder again and run the install from terminal:

cd $HOME/Downloads
cd hplip-3.13.7

As always if you have corrections or Additions, please let me know what they are.

Thank You,