I managed to successfully install the HP Laserjet 1018 printer on a Raspberry Pi 4 with Raspbian Buster by following the instructions below. It makes use of the foo2zjs linux printer driver.
These instructions are based on andrum99’s blog-post which is available on the Internet Archive.
1. Install pre-requisite packages:
sudo apt-get update
sudo apt-get install tix groff cups
2. Add user pi to lpadmin group:
sudo usermod -a -G lpadmin pi
3. Download and build foo2zjs:
wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz
tar zxf foo2zjs.tar.gz
4. Get the printer firmware:
5. Install foo2zjs and tool to download firmware to printer. Also, restart CUPS:
sudo make install install-hotplug cups
6. Plug in the HP Laserjet 1018 printer, and switch it on.
Orange light should flash and the printer motor will run for a few seconds, indicating firmware has been downloaded successfully.
Verify it has with:
The output of this command should include FWVER:20051028 or similar.
If no FWVER shown, firmware download has not worked.
7. Manually create cups printer (do not use the web interface):
sudo lpadmin -p hp1018 -v "usb://HP/LaserJet%201018" -E -P /usr/share/cups/model/HP-LaserJet_1018.ppd.gz
8. Set system default printer to the one we just created:
sudo lpadmin -d "hp1018"
9. Set default page size to A4:
sudo lpoptions -o media=A4
(use media=Letter to change back to letter if required)
10. Create a text file with the “Text Editor” application and use File -> Print… to print it.
The selected hp1018 printer should print the text file, possibly with a delay of up to 5 seconds.