How to Check Printer Ink Levels in Linux

3 min


A beginner’s guide to check printer ink levels in various Linux distributions.

Linux always has great printer support. Thanks to recent improvements in CUPS, almost all printers work out of the box in Linux. All you need to do is plug in and print. This applies to all the major distributions.

While printing is fine, one of the issues users face when they seek to monitor printer ink levels, especially that Linux drivers may not always provide this information.

In this tutorial, we’ll explore a few options for checking ink levels on Linux, for users who wish to stay informed about their printer’s ink status. While we explain the details, keep in mind the diverse range of printers available. It’s important to note that not all printers support ink level reporting, and this guide primarily applies to USB-connected printers. Additionally, the procedure focuses on the Libinklevel library, which is generally compatible with HP, Epson, and Canon printers.

Check ink levels in Linux

HP Printers – install and configure

Installing the HPLIP package directly from HP is the best solution for users with HP printers. Execute the following commands in your terminal. This will install the hplip base package and the GUI. The GUI gives you information about ink status and various information.

Ubuntu, Linux Mint and related:

sudo apt install hplip hplip-gui

Arch Linux

sudo pacman -S hplip

Fedora and related

sudo dnf install hplip hplip-gui

After the above installation is done, use the following command to configure your printer for the first time. Make sure you connect your printer before following below commands. Also, you can skip this step, if your printer is already configured in Linux.

  • Run the setup
hp-setup
  • If you have a USB printer, try the below:
hp-setup -b usb
  • If you know the IP address of your printer, you can use the below command (change the IP address to your printer IP:
hp-setup 1.1.1.1

The HP Device Manager would open, follow the onscreen instructions and add the printer.

Checking ink levels in HP printers

Once installed & configured, check your ink levels with the following command from the terminal.

hp-levels

As you can see, it shows a nice text representation of the current ink level in my test printer (HP Deskjet).

HP printer ink levels in terminal
HP printer ink levels in terminal

Alternatively, you can utilize the graphical user interface (GUI) program accessible from your system menu. Once opened, select the printer from the left section and go to the Supplies tab. You can see the status of Tri-color cartridge and blank ink.

HP printer ink levels in GUI
HP printer ink levels in GUI

Other Printers (EPSON and Others)

If you own printers from manufacturers like EPSON, the “ink” legacy program combined with libinklevel provides a solution. Execute the following command to install the necessary components:

Installing ink

Ubuntu, Linux Mint and related

sudo apt install ink libinklevel5

Arch Linux (set up Yay AUR helper and use the below command)

yay -S libinklevel
yay -S ink

Fedora and related distributions (you have to compile libinklevel and ink from srouce):

sudo dnf install libusb1-devel libxml2-devel
wget http://downloads.sourceforge.net/libinklevel/libinklevel-0.9.5.tar.gz
tar xzf libinklevel-0.9.5.tar.gz
cd libinklevel-0.9.5
./configure
make install
wget http://downloads.sourceforge.net/ink/ink-0.5.3.tar.gz
tar xzf ink-0.5.3.tar.gz
cd ink-0.5.3
./configure
make install

Running ink

After installation, run the program using the following command, adjusting parameters as needed:

ink -p <port> [-n <portnumber>] [-t <threshold>]

Here, “port” is set to “usb” and the optional parameters allow customization based on your printer’s specifics. For example, for USB printers use below:

ink -p usb

Here’s the ink output for the same printer above using terminal command:

Printer ink level using ink in Linux Mint
Printer ink level using ink in Linux Mint

For querying the ink levels of a BJNP Canon network printer:

ink -p bjnp

Or, by specifying the printer’s URI:

ink -b bjnp://<hostname or IP address>

To retrieve version information for “ink” and “libinklevel”:

ink -v

Closing Notes

While this guide should work for most printer models, keep in mind that not all printers support ink level communication, and results may vary.

The use of Libinklevel predominantly applies to USB-connected printers and currently supports HP, Epson, and Canon models. You can check out the supported device list here.


Arindam

Creator and author of debugpoint.com. Connect with me via Telegram, 𝕏 (Twitter), or send us an email.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

3 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments