Ways to Install and Uninstall pkg-config Ubuntu 22.04

Updated: September 16, 2022

pkg-config is a system for managing library compile and link flags that works with automake and autoconf. In this guide, I will show you ways to install pkg-config Ubuntu 22.04.

Prerequisites

  • Operating system: pkg-config needs Ubuntu 22.04 to work
  • Privileges: Ensure that you are able to execute the sudo commands line.

Prerequisites to install pkg-config on Ubuntu 22.04

Install pkg-config Ubuntu 22.04

pkg-config is one of the popular ways on Ubuntu now so that this tutorial will show you how to install it in various ways. Choose the one that you think is easy and you can follow.

Install pkg-config using APT

This is one of the popular ways to install any Ubuntu packages because it’s easy to follow, even if you are a newbie in Linux. Following these instructions to install pkg-config on your Ubuntu.

Step 1: Update the APT database to download new packages from Ubuntu. Launch the terminal and enter the following Linux command:

sudo apt -y update

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

sudo apt-get -y install pkg-config

Install pkg-config using Aptitude

Aptitude allows users to view a list of available packages and manage package installation, upgrade, and removal. If you haven’t already installed it on Ubuntu, run this command to do so.

sudo apt install aptitude

Then, you can now install pkg-config, just following these steps:

Step 1: You must update the APT package repository cache before attempting to install, update, or remove any packages. Obtain new packages from Ubuntu by updating the APT database. Launch the terminal and enter the following Linux command:

sudo apt-get update

Step 2: Install the package on Ubuntu 22.04. After updating, you can install pkg-config Ubuntu by pasting this command into the terminal and executing it.

sudo aptitude -y install pkg-config

Uninstall pkg-config on Ubuntu 22.04

Have you ever thought that uninstalling an application from Ubuntu might be challenging? You’re wrong; any program, not just a pkg-config, can be easily uninstalled by anyone.

This command can be used to uninstall pkg-config from Ubuntu 22.04 if it was installed using APT or Aptitude.

sudo apt remove --auto-remove pkg-config

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

sudo apt autoremove --purge pkg-config

Conclusion

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