How To Install splitpatch on Ubuntu 18.04

In this tutorial we learn how to install splitpatch on Ubuntu 18.04. splitpatch is split the patch up into files or hunks

Introduction

In this tutorial we learn how to install splitpatch on Ubuntu 18.04.

What is splitpatch

splitpatch is:

Divide a patch or diff file into pieces. The split can made by file or by hunk basis. This makes is possible to separate changes that might not be desirable or assemble the patch into more coherent set of changes.

The hunk option opens up possibility to compare similar patches hunk-by-hunk using tool like interdiff(1) from patchutils package. Operating on hunk level also gives more control, smilar to Git, to selectively shelve in changes e.g. to Version Control repository.

There are three methods to install splitpatch on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install splitpatch Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install splitpatch using apt-get by running the following command:

sudo apt-get -y install splitpatch

Install splitpatch Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install splitpatch using apt by running the following command:

sudo apt -y install splitpatch

Install splitpatch Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install splitpatch using aptitude by running the following command:

sudo aptitude -y install splitpatch

How To Uninstall splitpatch on Ubuntu 18.04

To uninstall only the splitpatch package we can use the following command:

sudo apt-get remove splitpatch

Uninstall splitpatch And Its Dependencies

To uninstall splitpatch and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove splitpatch

Remove splitpatch Configurations and Data

To remove splitpatch configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge splitpatch

Remove splitpatch configuration, data, and all of its dependencies

We can use the following command to remove splitpatch configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge splitpatch

References

Summary

In this tutorial we learn how to install splitpatch package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.