How To Install dumb-init on Ubuntu 18.04

In this tutorial we learn how to install dumb-init on Ubuntu 18.04. dumb-init is wrapper script which proxies signals to a child

Introduction

In this tutorial we learn how to install dumb-init on Ubuntu 18.04.

What is dumb-init

dumb-init is:

dumb-init is a simple process supervisor and init system designed to run as PID 1 inside minimal container environments (such as Docker).

Lightweight containers have popularized the idea of running a single process or service without normal init systems like systemd or sysvinit. However, omitting an init system often leads to incorrect handling of processes and signals, and can result in problems such as containers which can’t be gracefully stopped, or leaking containers which should have been destroyed.

dumb-init acts as PID 1 and immediately spawns your command as a child process, taking care to properly handle and forward signals as they are received.

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

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

sudo apt-get update

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

sudo apt-get -y install dumb-init

Install dumb-init Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install dumb-init

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

sudo aptitude -y install dumb-init

How To Uninstall dumb-init on Ubuntu 18.04

To uninstall only the dumb-init package we can use the following command:

sudo apt-get remove dumb-init

Uninstall dumb-init And Its Dependencies

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

sudo apt-get -y autoremove dumb-init

Remove dumb-init Configurations and Data

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

sudo apt-get -y purge dumb-init

Remove dumb-init configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge dumb-init

References

Summary

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