Software & AppsOperating SystemLinux

How To Completely Uninstall and Reinstall HP Printer Software on Ubuntu for Python 2 or 3

Ubuntu 2

In this article, we will guide you through the process of completely uninstalling and reinstalling the HP printer software, also known as HPLIP (HP Linux Imaging and Printing), on your Ubuntu system. This guide is applicable for both Python 2 and Python 3 environments.

Quick Answer

To completely uninstall and reinstall HP printer software on Ubuntu for Python 2 or 3, you need to first purge HPLIP using the sudo apt-get purge hplip command, then remove any leftover configuration files using sudo rm -rf /etc/hp. Next, depending on your Python version, install the necessary dependencies using the appropriate sudo apt-get install command. Finally, download the latest version of HPLIP from the official website, extract the downloaded file, and run sudo ./install.py to install HPLIP.

Overview

HPLIP is a free, open-source HP-developed solution for printing, scanning, and faxing with HP inkjet and laser-based printers in Linux. The HPLIP project provides printing support for over 2,080 printer models, including Deskjet, Officejet, Photosmart, PSC (Print, Scan, Copy), Business Inkjet, LaserJet, and LaserJet MFP.

Uninstalling the HP Printer Software

Before we begin the uninstallation process, make sure you have administrative privileges on your system.

Step 1: Purge HPLIP

Open the terminal and run the following command:

sudo apt-get purge hplip

The sudo command is used to run the following command with root permissions. apt-get is the package handling utility in Ubuntu, and purge is used to remove the packages and their configuration files.

Step 2: Remove Configuration Files

After purging HPLIP, remove any leftover configuration files by running the following command:

sudo rm -rf /etc/hp

The rm command is used for removing files and directories. The -rf option is used to remove directories and their contents recursively.

Checking Your Python Version

Before proceeding with the reinstallation, you need to check the version of Python installed on your system. This is important because the installation process differs slightly for Python 2 and Python 3.

To check your Python version, run the following command:

python3 --version

If the output shows a version number starting with 3 (e.g., Python 3.6), then you are using Python 3. If it shows a version number starting with 2 (e.g., Python 2.7), then you are using Python 2.

Reinstalling the HP Printer Software

Step 1: Install Dependencies

Depending on your Python version, you need to install the necessary dependencies for HPLIP and the printer.

For Python 3, run the following command:

sudo apt-get install python3-pyqt4 python3-dbus.mainloop.pyqt5 python3-pil

For Python 2, run the following command:

sudo apt-get install python-qt4 python-dbus.mainloop.qt python-imaging

These commands install the necessary Python libraries required for HPLIP.

Step 2: Download HPLIP

Download the latest version of HPLIP from the official website and extract the downloaded file.

Step 3: Install HPLIP

Open a terminal, navigate to the extracted directory, and run the following command to start the installation:

sudo ./install.py

Follow the on-screen instructions to complete the installation.

Conclusion

After reinstalling HPLIP, you can try setting up your HP printer again using the sudo hp-setup command. If you encounter any errors related to GUI support, try running the command with the --qt3 flag or in interactive mode (-i).

If you still face issues, you can consider using SimpleScan for scanning and your Brother LaserJet for printing. However, if you want to explore better scanning software, you can try other third-party applications like XSane or VueScan.

Note: Make sure your printer is connected and turned on before running the installation and setup commands.

By following these steps, you should be able to uninstall and reinstall the HP Printer Software on Ubuntu for Python 2 or 3 successfully.

Can I uninstall and reinstall the HP printer software on Ubuntu using Python 2 or Python 3?

Yes, you can uninstall and reinstall the HP printer software on Ubuntu using either Python 2 or Python 3. The steps provided in this guide are applicable for both Python versions.

Do I need administrative privileges to uninstall and reinstall the HP printer software?

Yes, you need administrative privileges to uninstall and reinstall the HP printer software. Make sure you have the necessary permissions before proceeding with the uninstallation and reinstallation process.

How do I check the version of Python installed on my Ubuntu system?

To check the version of Python installed on your Ubuntu system, open the terminal and run the command python3 --version. If the output shows a version number starting with 3, you are using Python 3. If it shows a version number starting with 2, you are using Python 2.

Where can I download the latest version of HPLIP?

You can download the latest version of HPLIP from the official website at http://hplipopensource.com/hplip-web/install/manual/distros/ubuntu.html. Make sure to download the appropriate version for your Ubuntu system.

What do I do if I encounter errors related to GUI support during the installation?

If you encounter errors related to GUI support during the installation, you can try running the sudo hp-setup command with the --qt3 flag or in interactive mode (-i). This may help resolve any GUI-related issues.

Can I use SimpleScan for scanning and my Brother LaserJet for printing if I encounter issues with HPLIP?

Yes, if you encounter issues with HPLIP, you can consider using SimpleScan for scanning and your Brother LaserJet for printing. However, if you want to explore better scanning software, you can try other third-party applications like XSane or VueScan.

Do I need to have my printer connected and turned on before running the installation and setup commands?

Yes, it is recommended to have your printer connected and turned on before running the installation and setup commands. This ensures that the software can properly detect and configure your printer during the installation process.

Leave a Comment

Your email address will not be published. Required fields are marked *