Ways to Uninstall or Install prometheus-sql-exporter on Ubuntu 22.04

Updated: September 11, 2022

This Prometheus exporter extracts various metrics from PostgreSQL, MySQL, and MSSQL databases. The metrics are configurable via a YAML file. In this guide, I will show you how to install prometheus-sql-exporter on Ubuntu 22.04.

Software Requirement

  • OS: prometheus-sql-exporter needs Ubuntu 22.04 to work
  • Privileges: Verify that you can execute the sudo commands line.

Prerequisites to install prometheus-sql-exporter on Ubuntu 22.04

Install prometheus-sql-exporter Ubuntu 22.04

prometheus-sql-exporter is one of the popular ways on Ubuntu now so that this tutorial will show you some ways to install it. Choose the one that you think is easy and you can follow.

Install prometheus-sql-exporter 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 steps to install prometheus-sql-exporter on your Ubuntu 22.04.

Step 1: You must update the APT package repository cache before attempting 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 -y update

Step 2: Start the package installation on Ubuntu 22.04. You can now install prometheus-sql-exporter Ubuntu by executing this command in the terminal.

sudo apt-get -y install prometheus-sql-exporter

Install prometheus-sql-exporter using Aptitude

With Aptitude, users can view a list of available packages and manage their installation, upgrade, and removal of packages. If you didn’t install it on Ubuntu, you need to install it by executing this command.

sudo apt -y install aptitude

Then, you can now install prometheus-sql-exporter by following these steps:

Step 1: You must update the APT package repository cache before attempting to install, update, or remove any packages. Update the APT database to fetch new packages from Ubuntu. Launching the terminal and entering the following Linux command:

sudo apt -y update

Step 2: Install the package on Ubuntu 22.04. You can now install prometheus-sql-exporter Ubuntu by executing this command in the terminal.

sudo aptitude install prometheus-sql-exporter

Uninstall prometheus-sql-exporter 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 prometheus-sql-exporter.

If you installed prometheus-sql-exporter using APT or Aptitude, you could uninstall prometheus-sql-exporter on Ubuntu by executing this command

sudo apt remove --auto-remove prometheus-sql-exporter

To uninstall prometheus-sql-exporter and remove its data and dependencies, you can also use the following command:

sudo apt autoremove --purge prometheus-sql-exporter

Ending

In this guide, I showed you ways to install prometheus-sql-exporter on Ubuntu 22.04 and ways to uninstall prometheus-sql-exporter too. If you need any help, don’t hesitate to contact me. I’m very glad to answer them.