Ways to Install and Uninstall uncrustify on Ubuntu 22.04

Updated: September 17, 2022

Uncrustify is a highly configurable source code formatter. It aligns preprocessor define’s, assignments, arithmetics and is able to fix spacing between operators. In this guide, I will show you ways to install uncrustify Ubuntu 22.04.

Requirements to install

  • Operating system: Ubuntu 22.04 or older Ubuntu versions
  • Privileges: Ensure that you are able to execute the sudo commands line.

Prerequisites to install uncrustify on Ubuntu 22.04

Install uncrustify Ubuntu 22.04

uncrustify 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 uncrustify using APT

This is one of the popular ways to install any Ubuntu packages because it is simple to understand, even if you are a Linux novice. Following these instructions to get uncrustify on your Ubuntu 22.04.

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. Launching the terminal and entering the following Linux command:

sudo apt update

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

sudo apt install uncrustify

Install uncrustify using Aptitude

You must run this command to install Aptitude if you haven’t already done so on Ubuntu.

sudo apt-get -y install aptitude

After that, you can now install uncrustify, just following these steps:

Step 1: Update the APT database to download new packages from Ubuntu. Opening the terminal and executing this Linux command:

sudo apt-get -y update

Step 2: Start installing the packages on Ubuntu 22.04. You can now install uncrustify Ubuntu by executing this command in the terminal.

sudo aptitude -y install uncrustify

Uninstall uncrustify on Ubuntu 22.04

Have you ever thought about how difficult it is to uninstall an application from Ubuntu? You are mistaken; anyone can easily uninstall any program, not just a package.

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

sudo apt remove --auto-remove uncrustify

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

sudo apt autoremove --purge uncrustify

Ending

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