How To Install ghp-import on Ubuntu 18.04

In this tutorial we learn how to install ghp-import on Ubuntu 18.04. ghp-import is Easily import docs to your gh-pages branch

Introduction

In this tutorial we learn how to install ghp-import on Ubuntu 18.04.

What is ghp-import

ghp-import is:

ghp-import is a Python script meant to make using GitHub’s gh-pages branches for hosting documentation simple.

Inside your repository just run ghp-import $DOCS_DIR where $DOCS_DIR is the path to the built documentation. This will write a commit to your gh-pages branch with the current documents in it.

There are three methods to install ghp-import 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 ghp-import Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install ghp-import

Install ghp-import Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install ghp-import

Install ghp-import 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 ghp-import using aptitude by running the following command:

sudo aptitude -y install ghp-import

How To Uninstall ghp-import on Ubuntu 18.04

To uninstall only the ghp-import package we can use the following command:

sudo apt-get remove ghp-import

Uninstall ghp-import And Its Dependencies

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

sudo apt-get -y autoremove ghp-import

Remove ghp-import Configurations and Data

To remove ghp-import configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge ghp-import

Remove ghp-import configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge ghp-import

References

Summary

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