How to Install and Uninstall wkhtmltopdf on Ubuntu 22.04

Updated: October 7, 2022

wkhtmltopdf is a command line program which permits one to create a pdf or an image from an url, a local html file or stdin. It produces a pdf or an image like rendered with the WebKit engine. In this guide, I will show you ways to install wkhtmltopdf Ubuntu 22.04.

Requirements

  • Operating system: Ubuntu 22.04 is needed for wkhtmltopdf to work
  • Privileges: Make sure you are able to execute sudo commands.

Prerequisites to install wkhtmltopdf on Ubuntu 22.04

Install wkhtmltopdf Ubuntu 22.04

wkhtmltopdf is one of the popular ways on Ubuntu now so that this tutorial will show you some ways to install it. Choose the one you believe is simple and easy to follow.

Install wkhtmltopdf using APT

This is a popular method for installing any Ubuntu packages because it is simple to understand, even if you are a Linux beginner. Following these instructions to get wkhtmltopdf on your Ubuntu.

Step 1: The APT package repository cache needs to be updated before you try to install, update, or remove any packages. Update the APT database to fetch new packages from Ubuntu. Opening the terminal and executing the following Linux command:

sudo apt-get update

Step 2: Start the package installation on Ubuntu 22.04. After updating the system, you can install wkhtmltopdf Ubuntu by executing this command in the terminal.

sudo apt-get install wkhtmltopdf

Install wkhtmltopdf using Aptitude

Users can manage their installation, upgrade, and removal of packages with Aptitude and view a list of the packages that are currently available. You must run this command to install it if you haven’t already done so on Ubuntu.

sudo apt-get -y install aptitude

After that, you can now install wkhtmltopdf by following these steps:

Step 1: The APT package repository cache needs to be updated before you try to install, update, or remove any packages. Update the APT database to download new packages from Ubuntu. Launching the terminal and entering the following Linux command:

sudo apt-get update

Step 2: Start installing the packages on Ubuntu 22.04. After updating, you can install wkhtmltopdf Ubuntu by executing this command in the terminal.

sudo aptitude install wkhtmltopdf

Uninstall wkhtmltopdf on Ubuntu 22.04

Have you ever thought that uninstalling an application from Ubuntu is difficult? You are mistaken; Anyone can easily uninstall any program, not just wkhtmltopdf.

If you installed wkhtmltopdf using APT or Aptitude, you could uninstall wkhtmltopdf on Ubuntu by executing this command

sudo apt remove --auto-remove wkhtmltopdf

If you want to uninstall wkhtmltopdf and remove its data and dependencies, you can also run the following command:

sudo apt autoremove --purge wkhtmltopdf

Ending

In this tutorial, I showed you ways to install wkhtmltopdf on Ubuntu 22.04 and ways to uninstall wkhtmltopdf too. Please contact me if you require any assistance. I’d be delighted to respond.