Installing HP printers and scanners on Ubuntu has never been easier, thanks to HPLIP (HP Linux Imaging and Printing). Whether you’re a Linux newcomer or an experienced user, this comprehensive guide will walk you through every step of the installation process, ensuring your HP devices work flawlessly with Ubuntu.
What is HPLIP and Why Do You Need It?
Understanding HP Linux Imaging and Printing
HPLIP is HP’s official open-source driver suite designed specifically for Linux systems. This powerful software package provides complete printing, scanning, and faxing functionality for HP devices on Ubuntu and other Linux distributions. Unlike generic drivers, HPLIP offers device-specific optimizations that unlock your HP printer’s full potential.
The software supports over 3,000 HP printer and scanner models, making it the go-to solution for HP device owners using Ubuntu. From basic inkjet printers to high-end laser multifunction devices, HPLIP ensures seamless integration with your Linux desktop.
Key Features and Benefits
HPLIP offers several advantages over standard Ubuntu printer drivers:
- Full device functionality: Access all printer features including duplex printing, multiple paper trays, and advanced print quality settings
- Scanner support: Complete scanning capabilities with preview, OCR, and document management features
- Fax functionality: Send and receive faxes directly from your Ubuntu desktop
- Device management: Monitor ink levels, perform maintenance tasks, and troubleshoot issues through the intuitive HPLIP toolbox
- Regular updates: HP continuously releases updates adding support for new devices and fixing compatibility issues
System Requirements and Prerequisites
Compatible Ubuntu Versions
HPLIP supports virtually all Ubuntu versions, including the latest Ubuntu 24.04 LTS, 22.04 LTS, and 20.04 LTS. The software is compatible with both 32-bit and 64-bit architectures, though 64-bit systems are recommended for optimal performance.
Hardware Requirements
Your Ubuntu system should meet these minimum requirements:
- RAM: 512 MB minimum (1 GB recommended)
- Storage: 500 MB free disk space
- USB port or network connection for device connectivity
- Python 3.x (usually pre-installed on Ubuntu)
Checking Your HP Device Compatibility
Before installation, verify your HP device compatibility by visiting HP’s official compatibility checker. Most HP printers manufactured after 2005 are supported, including popular series like LaserJet, OfficeJet, DeskJet, and Envy.
Preparing Your Ubuntu System
Updating System Packages
Before installing HPLIP, it’s crucial to update your Ubuntu system to prevent potential conflicts. Open your terminal using Ctrl+Alt+T
and run these commands:
sudo apt update && sudo apt upgrade
This ensures all existing packages are current and reduces installation issues.
Installing Essential Dependencies
HPLIP requires several system libraries to function properly. Install these dependencies first:
sudo apt install python3-dev python3-pip build-essential
sudo apt install libcups2-dev libavahi-core-dev
These packages provide the foundation for HPLIP’s core functionality and prevent common dependency errors during installation.
Method 1: Installing HPLIP from Ubuntu Repository
Quick Installation via APT
The simplest way to install HPLIP is through Ubuntu’s official repositories. This method works well for most users and provides a stable, tested version:
sudo apt install hplip hplip-gui hplip-data hplip-doc
This command installs:
- hplip: Core HPLIP functionality
- hplip-gui: Graphical user interface tools
- hplip-data: Device-specific data files
- hplip-doc: Documentation and help files
Pros and Cons of Repository Version
Advantages:
- Quick and easy installation
- Automatic dependency resolution
- Integrated with Ubuntu’s update system
- Stable and well-tested
Disadvantages:
- Often outdated compared to HP’s latest release
- May lack support for newest HP devices
- Limited access to cutting-edge features
Method 2: Installing Latest HPLIP Manually
Downloading the Official HPLIP Package
For the latest features and device support, download HPLIP directly from HP’s website. The current version is 3.24.4, though newer versions may be available:
wget https://sourceforge.net/projects/hplip/files/hplip/3.24.4/hplip-3.24.4.run/download -O hplip-3.24.4.run
Using the Automatic Installer (.run file)
The automatic installer streamlines the installation process, handling dependencies and configuration automatically.
Step-by-Step Installation Process
1. Make the file executable:
chmod +x ~/Downloads/hplip-3.24.4.run
2. Run the installer:
sh ~/Downloads/hplip-3.24.4.run
3. Follow installation prompts:
- Choose installation mode (automatic recommended)
- Select installation directory (default: /usr)
- Confirm dependency installation
- Enter your sudo password when prompted
4. Complete device setup:
The installer automatically launches the device setup wizard after installation, allowing you to add your HP printer or scanner immediately.
Method 3: Manual Build and Installation
Downloading Source Code
Advanced users can build HPLIP from source for maximum customization. Download the source tarball:
wget https://sourceforge.net/projects/hplip/files/hplip/3.24.4/hplip-3.24.4.tar.gz
tar -xf hplip-3.24.4.tar.gz
cd hplip-3.24.4
Configuring and Compiling HPLIP
Configure the build environment according to your system:
./configure --enable-gui-build --enable-hpcups-install --enable-cups-drv-install
This configuration enables the graphical interface and essential CUPS drivers.
Make and Install Commands
Compile and install HPLIP:
make
sudo make install
The compilation process typically takes 5-10 minutes depending on your system’s performance.
Configuring HPLIP After Installation
Running HP-Setup
After successful installation, configure your HP device using the hp-setup utility:
hp-setup
This launches the HPLIP Device Setup Wizard, guiding you through device configuration.
Device Discovery and Connection
USB Connection Setup
For USB-connected devices:
- Connect your HP device via USB cable
- Power on the device
- Run hp-setup and select “USB” connection type
- HPLIP automatically detects connected devices
- Select your device from the list
Network/Wireless Connection Setup
For network-connected devices:
- Ensure your HP device is connected to the same network as your Ubuntu system
- Note your printer’s IP address from its display panel
- Run hp-setup and select “Network/Wireless” connection
- Enter the IP address if automatic detection fails
- Complete the setup wizard
Network setup success rates are typically above 90% for properly configured devices.
Testing Your HP Printer and Scanner
Printing Test Pages
Verify printer functionality by printing a test page:
hp-testpage
Or through the graphical interface: System Settings → Printers → Select your HP printer → Print Test Page
Scanner Functionality Test
Test scanner operation using:
hp-scan
The HPLIP scanner interface provides preview, resolution selection, and format options for comprehensive scanning capabilities.
Using HPLIP Toolbox
The HPLIP Toolbox offers comprehensive device management:
hp-toolbox
Key toolbox features include:
- Device status monitoring: Real-time ink levels and error notifications
- Maintenance functions: Print head cleaning and alignment
- Print job management: Queue monitoring and job cancellation
- Device settings: Access to advanced printer configurations
Troubleshooting Common Installation Issues
Dependency Problems
Missing dependencies are the most common installation obstacles. If you encounter dependency errors:
1. Update package lists:
sudo apt update
2. Install missing packages manually:
sudo apt install python3-pyqt5 python3-pyqt5-dbus
3. Fix broken dependencies:
sudo apt --fix-broken install
Python-PyQt5 Issues
Ubuntu 20.04 and newer versions sometimes experience Python-PyQt5 compatibility issues. Resolution steps:
1. Install alternative PyQt5 packages:
sudo apt install python3-pyqt5.qtopengl python3-pyqt5.qtmultimedia
2. Use pip3 as fallback:
pip3 install --user PyQt5
Permission Errors
Permission issues typically occur during manual installation. Solutions:
1. Ensure proper file permissions:
sudo chown -R $USER:$USER ~/Downloads/hplip*
2. Run installer with appropriate privileges:
sudo sh ~/Downloads/hplip-3.24.4.run
3. Check SELinux/AppArmor policies (if applicable)
Managing and Updating HPLIP
Checking Current Version
Verify your installed HPLIP version:
hp-check -v
This command also provides system compatibility information and identifies missing dependencies.
Updating to Latest Version
HPLIP updates frequently, often monthly, adding new device support and bug fixes. To update:
- Download the latest version from HP’s website
- Uninstall the current version (if using manual installation)
- Install the new version following the same process
Uninstalling HPLIP
For manual installations, HPLIP includes an uninstall script:
sudo python3 ~/Downloads/hplip-source-folder/uninstall.py
For repository installations:
sudo apt remove hplip hplip-gui hplip-data
Frequently Asked Questions (FAQs)
Q1: Which HPLIP installation method should I choose?
A: For most users, the automatic installer (.run file) provides the best balance of features and ease of use. Choose the repository version only if you prefer system-managed packages, or the manual build if you need specific customizations.
Q2: Why isn’t my HP printer detected after HPLIP installation?
A: Ensure your printer is powered on and properly connected. For USB connections, try different cables and ports. For network printers, verify both devices are on the same network and check firewall settings.
Q3: Can I install multiple versions of HPLIP simultaneously?
A: No, having multiple HPLIP versions can cause conflicts. Always uninstall the previous version before installing a new one, especially when switching between repository and manual installations.
Q4: How often should I update HPLIP?
A: HP releases HPLIP updates approximately monthly. Update when you need support for new devices, encounter compatibility issues, or want the latest features and bug fixes.
Q5: What should I do if HPLIP installation fails due to dependency issues?
A: First, ensure your Ubuntu system is fully updated. Then install missing dependencies manually using apt. If problems persist, try the repository version, which handles dependencies automatically.