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
cd foo2zjs
make