How To: Install and Configure for HP Printer

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Locked
srq2625

How To: Install and Configure for HP Printer

Post by srq2625 »

It seems many people are having difficulties printing with their HP printers. The following is a short How To to get them started.

Printing with HP printers is best(?) facilitated using the hplip software. There are at least two sources for the software (1) the LM repositories and (2) developers.hp.com. Obviously, it is best to use the software in the repository if it supports your printer.
  1. Determine the version of hplip in the LM repository:

    Code: Select all

    $ apt-cache policy hplip
  2. Determine if the hplip software in the LM repository supports your printer.
    1. Go to The Supported HP Printer index page
    2. Search for your printer.
    3. Finding your printer and compare the version of hplip that first supported your printer against the version available in the repository. If that in the repo is later than the first supporting your printer, install from the repo (see below). Otherwise, if your printer requires a version of hplip newer than is available in the repos or your printer is not listed amongst the supported devices (the list may not be updated in a timely fashion) compile and install from source (see further below).
Installing from the LM repository
Execute each of these commands in turn, understanding that each will require some configuration information.

Code: Select all

$ sudo apt install hplip hplip-gui xsane
$ hp-setup
$ hp-plugin
These commands perform the following:
  1. Installs the hplip (and supporting) packages
  2. Starts the printer configuration process. The user will be required to help the software "discover" the printer and enter other configuration information.
  3. This command is necessary only if your device has a scanner
Once the above commands have been successfully performed, your printer (and scanner, if applicable) should be fully functioning.

Installing from source
  1. Download the source code tar file. The link to the file can be found in the "Advanced Option" of this page. At the time of this writing, the file is hplip-3.18.9.tar.gz
  2. Open a terminal window and cd to the folder into which the tar file was downloaded.
  3. Execute the command

    Code: Select all

    tar xf hplip-3.18.9.tar.gz
  4. cd hplip-3.18.9
  5. Install all the packages necessary for a successful compile and installation (note that some of these packages may already be installed):

    Code: Select all

    apt-get install --install-recommends build-essential libjpeg-turbo8-dev avahi-utils cups libcups2 libcups2-dev cups-bsd cups-client libcupsimage2 libcupsimage2-dev libdbus-1-dev g++ ghostscript cups-filters ghostscript-x libssl-dev libsnmp-dev snmp libc6 libtool libtool-bin libusb-1.0-0-dev make wget policykit-1 policykit-1-gnome python3-dbus python3-gi python3-dev python3-notify2 python3-pil python3-pyqt4 gtk2-engines-pixbuf python3-dbus.mainloop.qt python3-reportlab python3-lxml sane libsane-dev sane-utils xsane python-dev python-qt4 python-qt4-dev python-pyqt5 python-dbus
  6. Configure ....

    Code: Select all

    ./configure --prefix=/usr --with-hpppddir=/usr/share/ppd/HP --libdir=/usr/lib/x86_64-linux-gnu --enable-qt4 --enable-hpcups-install --enable-cups-drv-install --disable-cups-ppd-install --disable-hpijs-install --disable-foomatic-drv-install --disable-foomatic-ppd-install --disable-foomatic-rip-hplip-install --enable-fax-build --enable-dbus-build --enable-network-build --enable-scan-build --disable-policykit --disable-libusb01_build --disable-udev_sysfs_rules --enable-doc-build
  7. Compile the source

    Code: Select all

    $ make
  8. Install the software

    Code: Select all

    sudo make install
  9. Configure for the printer

    Code: Select all

    $ hp-setup
  10. (Optional, if you have a scanner)

    Code: Select all

    hp-plugin
Note: It may be wise to retain the tar file should the need ever arise that you wish to uninstall the software:
  1. Perform steps 2, 3 (if necessary), 4, and 6
  2. Execute

    Code: Select all

    sudo make uninstall
Work ToDo: Figure out how to build a package from the source. Building a package will allow for the possibility of using dpkg to install/uninstall and remove the need to retain the tar file.
Bayvista170
Level 1
Level 1
Posts: 49
Joined: Tue Jun 21, 2016 4:28 am

Re: How To: Install and Configure for HP Printer

Post by Bayvista170 »

I have followed the instructions to install and configure an HP Printer. However, on running HP Device manager, It says 'No HP Devices Found'. Under 'Administration/Printers' it shows my HP Laserjet P1102w. Properties shows 'Sending data to printer'. However, the printer dos not print.

This all happened because I tried to update my copy of HP Device Manager with V 3.19.6 because the previous version kept hanging.

I am running Linux Mint 18.3.
akstirling

Re: How To: Install and Configure for HP Printer

Post by akstirling »

As someone approaching the install of a Deskjet printer with more than a whisker of trepidation on the strength of a past struggle, I wish to thank srq2625 for his succinct set of commands (under the banner: Installing from the LM Repository) which turned a potential serious headache into an absolute doddle .... thank you very much ......
User avatar
karlchen
Level 23
Level 23
Posts: 18209
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: How To: Install and Configure for HP Printer

Post by karlchen »

<mod>
Help requests do not go into a tutorial. So Gladeous's help request has gone into this new thread: Problem adding printer HP6310.
</mod>
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 771 days now.
Lifeline
Locked

Return to “Tutorials”