Install HP Laserjet P1007 in Debian and Ubuntu

This was the easiest installation I’ve ever seen in a Linux distro, comparable to Windows Plug and Play

I plugged in my printer. As expected nothing happened. I tried to fathom what happened:

[[email protected] c]$ sudo tail -f /var/log/messages
Dec  7 10:49:38 debian kernel: [ 6316.051712] usb 1-7.1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Dec  7 10:49:38 debian kernel: [ 6316.051715] usb 1-7.1.2: Product: HP LaserJet P1007
Dec  7 10:49:38 debian kernel: [ 6316.051718] usb 1-7.1.2: Manufacturer: Hewlett-Packard
Dec  7 10:49:38 debian kernel: [ 6316.051720] usb 1-7.1.2: SerialNumber: EC0FCLS
Dec  7 10:49:38 debian kernel: [ 6316.051849] usb 1-7.1.2: configuration #1 chosen from 1 choice
Dec  7 10:49:39 debian kernel: [ 6316.635466] usblp1: USB Bidirectional printer dev 7 if 0 alt 0 proto 2 vid 0x03F0 pid 0x4817
Dec  7 10:49:39 debian kernel: [ 6316.635500] usbcore: registered new interface driver usblp
Dec  7 10:49:39 debian kernel: [ 6317.567202] usb 1-7.1.2: usbfs: interface 0 claimed by usblp while 'usb' sets config #1
Dec  7 10:49:42 debian /usr/sbin/hpljP1007: foo2zjs: Missing HP LaserJet P1007 firmware file /lib/firmware/hp/sihpP1005.dl
Dec  7 10:49:42 debian /usr/sbin/hpljP1007: foo2zjs: ...read foo2zjs installation instructions and run ./getweb P1007

That was very instructive. Ok, so I have to execute ./getweb. From where.

Since it said foo2zjs I tried to find out where foo2zjs was located

[[email protected] c]$ which foo2zjs
/usr/bin/foo2zjs

Great. So:

[[email protected] c]$ cd /usr/bin
[[email protected] bin]$ which foo2zjs
/usr/bin/foo2zjs
[[email protected] bin]$ ./getweb P1007
You need to be root
[[email protected] bin]$ sudo ./getweb P1007
sihpP1005.img

(c) Copyright Hewlett-Packard 2008

[[email protected] bin]$ sudo tail -f /var/log/messages
Dec  7 10:49:38 debian kernel: [ 6316.051712] usb 1-7.1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Dec  7 10:49:38 debian kernel: [ 6316.051715] usb 1-7.1.2: Product: HP LaserJet P1007
Dec  7 10:49:38 debian kernel: [ 6316.051718] usb 1-7.1.2: Manufacturer: Hewlett-Packard
Dec  7 10:49:38 debian kernel: [ 6316.051720] usb 1-7.1.2: SerialNumber: EC0FCLS
Dec  7 10:49:38 debian kernel: [ 6316.051849] usb 1-7.1.2: configuration #1 chosen from 1 choice
Dec  7 10:49:39 debian kernel: [ 6316.635466] usblp1: USB Bidirectional printer dev 7 if 0 alt 0 proto 2 vid 0x03F0 pid 0x4817
Dec  7 10:49:39 debian kernel: [ 6316.635500] usbcore: registered new interface driver usblp
Dec  7 10:49:39 debian kernel: [ 6317.567202] usb 1-7.1.2: usbfs: interface 0 claimed by usblp while 'usb' sets config #1
Dec  7 10:49:42 debian /usr/sbin/hpljP1007: foo2zjs: Missing HP LaserJet P1007 firmware file /lib/firmware/hp/sihpP1005.dl
Dec  7 10:49:42 debian /usr/sbin/hpljP1007: foo2zjs: ...read foo2zjs installation instructions and run ./getweb P1007

So it downloaded the file but again gave the same message. I decided to unplug and replug the printer.

Sure enough I was greeted by the familiar startup sound of the printer… And confirmation from syslog:

[[email protected] bin]$ sudo tail -f /var/log/messages
Dec  7 10:53:42 debian kernel: [ 6560.287745] usb 1-7.1.2: New USB device found, idVendor=03f0, idProduct=4817
Dec  7 10:53:42 debian kernel: [ 6560.287750] usb 1-7.1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Dec  7 10:53:42 debian kernel: [ 6560.287754] usb 1-7.1.2: Product: HP LaserJet P1007
Dec  7 10:53:42 debian kernel: [ 6560.287756] usb 1-7.1.2: Manufacturer: Hewlett-Packard
Dec  7 10:53:42 debian kernel: [ 6560.287759] usb 1-7.1.2: SerialNumber: EC0FCLS
Dec  7 10:53:42 debian kernel: [ 6560.287903] usb 1-7.1.2: configuration #1 chosen from 1 choice
Dec  7 10:53:42 debian kernel: [ 6560.290938] usblp1: USB Bidirectional printer dev 8 if 0 alt 0 proto 2 vid 0x03F0 pid 0x4817
Dec  7 10:53:43 debian kernel: [ 6561.402520] usb 1-7.1.2: usbfs: interface 0 claimed by usblp while 'usb' sets config #1
Dec  7 10:53:45 debian /usr/sbin/hpljP1007: foo2zjs: loading HP LaserJet P1007 firmware /lib/firmware/hp/sihpP1005.dl to /dev/usb/lp1 ...
Dec  7 10:53:46 debian /usr/sbin/hpljP1007: foo2zjs: ... download successful.
Dec  7 10:53:58 debian udev-configure-printer: Re-enabled printer ipp://localhost:631/printers/HP-LaserJet-P1007

Going to the printers applet, I could see a new Laserjet P1007 installed. Installed a test print.

Related info can be found here.

Install printer in Kubuntu 12.10

It was too easy. Everything was Plug and play.

However if it doesnt install for you, you can try downloading the file from HP and installing it:

First use the system script to download the driver:

/usr/bin/python /usr/bin/hp-plugin -i

Now install it:

sh /tmp/hplip-3.12.6-plugin.run --nox11 -- -i
[[email protected] droidzone]#/usr/bin/python /usr/bin/hp-plugin -i

HP Linux Imaging and Printing System (ver. 3.12.6)
Plugin Download and Install Utility ver. 2.1

Copyright (c) 2001-14 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

error: PolicyKit support requires DBUS or PolicyKit support files missing
(Note: Defaults for each question are maked with a '*'. Press <enter> to accept the default.)

\
-----------------------------------------
| PLUG-IN INSTALLATION FOR HPLIP 3.12.6 |
-----------------------------------------

The driver plugin for HPLIP 3.12.6 appears to already be installed.
Do you wish to download and re-install the plug-in? (y=yes*, n=no, q=quit) ?

 

sh /tmp/hplip-3.12.6-plugin.run --nox11 -- -i
Verifying archive integrity... All good.
Uncompressing HPLIP 3.12.6 Plugin Self Extracting Archive.......................................................

HP Linux Imaging and Printing System (ver. 3.12.6)
Plugin Installer ver. 3.0

Copyright (c) 2001-14 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Plug-in version: 3.12.6
Installed HPLIP version: 3.12.6
Number of files to install: 50

You must agree to the license terms before installing the plug-in:

LICENSE TERMS FOR HP Linux Imaging and Printing (HPLIP) Driver Plug-in   
........................
Do you accept the license terms for the plug-in (y=yes*, n=no, q=quit) ? y

Done.

 

 

d


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Installing Debian

The first time I used the GUI, it failed to install. The next time I started off the Text Rescue mode, setup partitions and installed it fine. However it would not recognize my display and the monitor would switch off. Having faced a similiar issue with Nvidia drivers on Ubuntu, I thought that might be the fault and tried to install the Nvidia driver as outlined here:

http://wiki.debian.org/NvidiaGraphicsDrivers#Installation-1

However it would not install module-assistant and gave me an error that the package could not be found.

apt-get install module-assistant nvidia-kernel-common[/code]
Searching for the package, I found it here: http://packages.debian.org/squeeze/all/module-assistant/download

While trying to add the package source to /etc/apt/sources.list, I found that my sources list was tiny-just three lines. I found that odd as my Ubuntu installation usually had scores of package sources listed in that file. So I had a hunch that this might be at the core of the issue.

I added the following line to sources.list:
deb http://ftp.de.debian.org/debian squeeze main contrib non-free[/code]
And ran apt-get update
apt-get update

 

Sure enough, module-assistant could now be installed.

apt-get install module-assistant nvidia-kernel-common

At this point, you'll probably get locale errors like: "Cannot set LC_TYPE". Ignore them. The method to fix them is described elsewhere on this blog.

Note that it is recommended that you do NOT manually install build-essential, since that installs a newer gcc version. We need gcc-4.3 for our kernel compilation. Reverting to older gcc proved very messy when I tried it. When you install the above packages, the correct gcc version will be automatically installed as a dependency.

Now I had to run:

# m-a auto-install nvidia-kernel${VERSION}-source

I was prompted to install build-essential and a host of other packages includin the Linux kernel source, presumably to try to compile the Nvidia kernel driver.

Now, install the NVIDIA X driver and user-space libraries

apt-get install nvidia-glx${VERSION}[/code]
Install the NVIDIA X configurator
apt-get install nvidia-xconfig

Or combine all three with:

apt-get install nvidia-glx nvidia-xconfig nvidia-settings

 

Run the module assistant:

m-a

PREPARE to build modules

SELECT

[X]alsa and

[X]nvidia-kernel

Enter

GET or update source package

At this point, the selected modules sources will be downloaded.

Select Build

Install them, and confirm by listing installed sources. Note that these have to be done from actual Debian boot and not the livecd. I found that even after running all this in the livecd shell, I could not get a screen in the booted version.

So, after building and installing proper kernel modules from the Live CD, reset root password from Live CD, and now remove CD and reboot to HDD

When GRUB shows its menu, choose the second option-i.e Rescue 686.

Now you land at the command prompt, being asked for a password. Use the root password.

Now run:

m-a

So I had to select 686 rescue mode and re-run m-a

Now,

PREPARE

SELECT alsa and nvidia-kernel

GET (seems to complete instantaneously)

BUILD

 

Now run

nvidia-xconfig

At this point your system is ready to run X.

You can test by running:

kdm

right now. It will warn about missing theme file, show a part of the Nvidia GUI splash and momentarily land you back at the command prompt.

At this point, you can shutdown and restart the computer:

shutdown -h now

 

For me, everything seemed to work. However I can done this from the Rescue mode of the LiveDVD, and when I tried to boot from HDD, all I got was it getting hung trying to start X and kdm, saying the module 'nvidia' was not found.

Module 'nvidia' not found

I had to repeat the following step from the root shell of the actual installed system.

# m-a auto-install nvidia-kernel${VERSION}-source[/code]
 

To do this, I had to actually reset the root password since I found that the root user password had not been set correctly.

Execute the following from the Rescue system
passwd

The command sets the root password.

 

After this, nvidia module was successfully compiled, and it booted to kdm.

However I had to create another normal user before I could login to kdm. This can be easily done by pressing Ctrl-F1 while being shown the graphical login prompt. Here, login as root and execute the following:

useradd droidzone ; passwd droidzone

 

 

 


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.