How to install Printer Driver For HP LaserJet 1020

Hi Spikerguy,
@Spikerguy,

I am trying to install foo2zjs Printer Driver for HP LaserJet 1020 on Manjaro-ARM. Here are the steps taken:

  1. $ wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz
  2. $ tar zxf foo2zjs.tar.gz
  3. $ cd foo2zjs
  4. $ make
  5. $ ./getweb 1020
  6. $ sudo make install

All six (6) steps successful. Except step 7. “Install vim package(s) for your OS”. What “vim package(s)” should I install?

  1. $ sudo make install-hotplug

[jfl@MNJROGTKPRO foo2zjs]$ sudo make install-hotplug

Hotplug Installation Dependencies…

  ***
  *** Error: ex is not installed!
  ***
  *** Install vim package(s) for your OS
  ***

make: *** [Makefile:998: install-hotplug-test] Error 1

Use youre pamac to search for vim … much possibilitys of this “horrible” editor :slight_smile:

I do not mean to de-rail this thread… but cups uses .ppd files and one is available for this printer. Why not simply put the ppd file in the correct directory and then create a printer and set it to use the ppd? Is there something more here?

sudo pacman -S vim

Should do

As far as I know, HP LaserJet 1020 required a binary Hot-Pluging to work.

Not sure which “vim” package(s) it is referring to? Is it the “vim” text editor?

Ah, I searched and see the issue. Very well… continue on. :slight_smile:

Installed vim by “sudo pacma -S vim” successful but still the same error when with
sudo make install-hotplug.

Error: ex is not installed! (what is “ex” not installed)
Install vim package(s) for your OS

[jfl@MNJROGTKPRO foo2zjs]$ sudo pacman -S vim
[sudo] password for jfl: 
resolving dependencies...
looking for conflicting packages...

Packages (2) vim-runtime-8.2.1989-3  vim-8.2.1989-3

Total Download Size:    7.37 MiB
Total Installed Size:  34.01 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 vim-runtime-8.2....     5.8 MiB   920 KiB/s 00:06 [####################] 100%
 vim-8.2.1989-3-a...  1583.9 KiB   916 KiB/s 00:02 [####################] 100%

:: Running post-transaction hooks...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Updating icon theme caches...
(3/3) Updating the desktop file MIME type cache...

[root@MNJROGTKPRO foo2zjs]# sudo make install-hotplug
#
# Hotplug Installation Dependencies...
#
      ***
      *** Error: ex is not installed!
      ***
      *** Install vim package(s) for your OS
      ***
make: *** [Makefile:998: install-hotplug-test] Error 1

It would seem the packaging does not create the /usr/bin/ex file, which is just a symbolic link to vim.

$ sudo ln -s /usr/bin/vim /usr/bin/ex

This should create the symbolic link /usr/bin/ex which points to /usr/bin/vim

$ ls -l /usr/bin/ex

lrwxrwxrwx 1 root root 12 Jan 20 10:05 /usr/bin/ex -> /usr/bin/vim

So that when /usr/bin/ex is executed, it is actually running /usr/bin/vim.

thats correct:
ex excecutes vim

Just tested on Deepin … and still don’t know at once how to quit this editor vim … yes i hate vim!!!

Thanks for the guidance, "sudo ln -s /usr/bin/vim /usr/bin/ex
It remove the dependencies error of ex not installed but now with new dependencies. It seems to be a moving target? Hope I getting closer. Isn’t the system-config-printer-udev required for configuring printers in Manjaro? To remove?

[jfl@MNJROGTKPRO foo2zjs]$ sudo ln -s /usr/bin/vim /usr/bin/ex
[sudo] password for jfl: 
[jfl@MNJROGTKPRO foo2zjs]$ ls -l /usr/bin/ex
lrwxrwxrwx 1 root root 12 Jan 21 21:37 /usr/bin/ex -> /usr/bin/vim
[jfl@MNJROGTKPRO foo2zjs]$ sudo make install-hotplug
#
# Hotplug Installation Dependencies...
#
      ***
      *** Error: system-config-printer-udev is installed!
      ***
      *** Remove it with: (Fedora)
      *** 	# dnf remove system-config-printer-udev
      *** OR
      *** 	# rpm -e --nodeps system-config-printer-udev
      *** OR (Ubuntu, Debian)
      *** 	$ sudo apt-get remove system-config-printer-udev
      *** OR (SUSE)
      *** 	# zypper rm udev-configure-printer
      *** OR (generic linux)
      ***	# rm -f /lib/udev/rules.d/*-printers.rules
      ***
make: *** [Makefile:999: install-hotplug-test] Error 1

Warning: Messing around with udev rules can break your system. But if you restrict it to printer stuff, you should be fine.

I checked my system and I do have a /lib/udev/rules.d/udev-configure-printer file.
Note: I think the last line “rm -f /lib/udev/rules.d/*-printers.rules” contains a typo. I don’t think “printers” should be plural.

You could move the file to a different name, so you can easily restore it, if you find this is a dead end. I assume this install will add its own version of the udev rule.

$ mv /lib/udev/rules.d/udev-configure-printer /lib/udev/rules.d/udev-configure-printer.disabled

If a replacement file is added, I would compare it to the original, to confirm it is compatible with Manjaro.

I just check what is currently in “/lib/udev/rules.d/70-printers.rules”. What if just rename this “70-printers.rules” to say “70-printers.rules_old”. With this basically now “70-printers.rules” does not exist as far as Manjaro or foo2zjs or system-config-printer-udev is concerned.

Do you think this will do the trick?

'# UDEV rules for USB devices - ENV variables can be monitored
'# via 'sudo udevadm monitor --udev --subsystem-match=usb --property'
'# Low-level USB device add trigger
ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701??:*", ENV{ID_USB_INTERFACES}!="*:070104:*", TAG+="systemd", ENV{SYSTEMD_WANTS}="configure-printer@usb-$env{BUSNUM}-$env{DEVNUM}.service"
'# Low-level USB device remove trigger
'# Interface types:
'# 7/1/1 - device with unidirectional USB, managed by usb backend
'# 7/1/2 - device with bidirectional USB, managed by usb backend
'# 7/1/3 - device with special USB protocol, managed by hp backend
'# 7/1/4 - device with IPP over USB protocol, managed by ipp-usb daemon
ACTION=="remove", SUBSYSTEM=="usb", ENV{INTERFACE}=="7/1/*", ENV{INTERFACE}!="7/1/4", RUN+="udev-configure-printer remove %p"

EDIT: Update. After renaming “70-printers.rules” to “70-printers.rules_old” it did the trick to complete the “sudo make install-hotplug”.

Now lets see whether it can print. Based on experience with Ubuntu-Legacy-4.9 able to complete all the installation including “hotplug” does not mean it will recognise or get LaserJet_1020 to print.

[jfl@MNJROGTKPRO ~]$ cd foo2zjs
[jfl@MNJROGTKPRO foo2zjs]$ sudo make install-hotplug
[sudo] password for jfl: 
'#
'# Hotplug Installation Dependencies...
'#
'# ... OK!
'#
'#
'#	remove HPLIP (proprietary) files and install our version
'#
if [ -d /etc/udev/rules.d ]; then \
    rm -f /etc/udev/rules.d/*hpmud*laserjet_1000*; \
    rm -f /etc/udev/rules.d/*hpmud*laserjet_1005*; \
    rm -f /etc/udev/rules.d/*hpmud*laserjet_1018*; \
    rm -f /etc/udev/rules.d/*hpmud*laserjet_1020*; \
    rm -f /etc/udev/rules.d/*hpmud*laserjet_p1005*; \
    rm -f /etc/udev/rules.d/*hpmud*laserjet_p1006*; \
    rm -f /etc/udev/rules.d/*hpmud*laserjet_p1007*; \
    rm -f /etc/udev/rules.d/*hpmud*laserjet_p1008*; \
    rm -f /etc/udev/rules.d/*hpmud*laserjet_p1505*; \
    rm -f /etc/udev/rules.d/*hpmud_support.rules; \
    rm -f /etc/udev/rules.d/*hpmud_plugin.rules; \
    rm -f /lib/udev/rules.d/*hpmud_support.rules; \
    rm -f /lib/udev/rules.d/*hpmud_plugin.rules; \
    rm -f /lib/udev/rules.d/*-hplj10xx.rules; \
    if [ -x /sbin/udevd ]; then \
	version=`/sbin/udevd --version 2>/dev/null`; \
    elif [ -x /usr/lib/udev/udevd ]; then \
	version=`/usr/lib/udev/udevd --version 2>/dev/null`; \
    elif [ -x /lib/systemd/systemd-udevd ]; then \
	version=`/lib/systemd/systemd-udevd --version 2>/dev/null`; \
    elif [ -x /usr/lib/systemd/systemd-udevd ]; then \
	version=`/usr/lib/systemd/systemd-udevd --version 2>/dev/null`; \
    fi; \
    version=`echo $version | sed -e 's/^v//' -e 's/-.*//' -e 's/\..*//'`; \
    if [ "$version" = "" ]; then version=0; fi; \
    echo "***"; \
    echo "*** udev version $version"; \
    echo "***"; \
    if [ "$version" -lt 148 ]; then \
	install -c -m 644 hplj10xx.rules.old /etc/udev/rules.d/11-hplj10xx.rules; \
    else \
	install -c -m 644 hplj10xx.rules /etc/udev/rules.d/11-hplj10xx.rules; \
    fi \
fi
***
*** udev version 247
***
if [ -d /etc/devd ]; then \
    install -c -m 644 hplj10xx.conf /etc/devd/; \
fi
[ -d /etc/hotplug/usb ] || install -d -m 755 /etc/hotplug/usb/
install -c -m 755 hplj1000 /etc/hotplug/usb/
ln -sf /etc/hotplug/usb/hplj1000 /etc/hotplug/usb/hplj1005
ln -sf /etc/hotplug/usb/hplj1000 /etc/hotplug/usb/hplj1018
ln -sf /etc/hotplug/usb/hplj1000 /etc/hotplug/usb/hplj1020
ln -sf /etc/hotplug/usb/hplj1000 /etc/hotplug/usb/hpljP1005
ln -sf /etc/hotplug/usb/hplj1000 /etc/hotplug/usb/hpljP1006
ln -sf /etc/hotplug/usb/hplj1000 /etc/hotplug/usb/hpljP1007
ln -sf /etc/hotplug/usb/hplj1000 /etc/hotplug/usb/hpljP1008
ln -sf /etc/hotplug/usb/hplj1000 /etc/hotplug/usb/hpljP1505
/etc/hotplug/usb/hplj1000 install-usermap
/etc/hotplug/usb/hplj1005 install-usermap
/etc/hotplug/usb/hplj1018 install-usermap
/etc/hotplug/usb/hplj1020 install-usermap
/etc/hotplug/usb/hpljP1005 install-usermap
/etc/hotplug/usb/hpljP1006 install-usermap
/etc/hotplug/usb/hpljP1007 install-usermap
/etc/hotplug/usb/hpljP1008 install-usermap
/etc/hotplug/usb/hpljP1505 install-usermap
# modprobe usblp
/etc/hotplug/usb/hplj1000 install-usblp
[jfl@MNJROGTKPRO foo2zjs]$

Yes! Finally successful in installting foo2zjs on Manjaro-ARM and got to print on HP LaserJet_1020. Thanks @0n0w1c, @spikerguy, @Wollie, @JohnML and all that had guided me through to finally install a printer driver (foo2zjs) in Manjaro-ARM to print on HP LaserJet_1020.

It has been a long journey, which initially I thought should only take a few minutes! Frankly, almost given up.

3 Likes

Great :slight_smile:

… but keep that directory foo2zjs, you’ll need that after kernel update to reinstall foo2zjs.

Thanks for the tip, will do. Just copy the foo2zjs over after new kernel update?