How To Install earlyoom on Ubuntu 22.04

In this tutorial we learn how to install earlyoom on Ubuntu 22.04. earlyoom is Early OOM Daemon

Introduction

In this tutorial we learn how to install earlyoom on Ubuntu 22.04.

What is earlyoom

earlyoom is:

Earlyoom is an userspace OOM-killer which can avoid the system to get into unresponsive state caused by swapping, which is most likely to occur when a large swap is present and memory is tight. It checks the amount of available memory and swap periodically, and when both are below a preconfigured value, it kills the largest process.

There are three methods to install earlyoom on Ubuntu 22.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 earlyoom Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install earlyoom

Install earlyoom Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install earlyoom

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

sudo aptitude -y install earlyoom

How To Uninstall earlyoom on Ubuntu 22.04

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

sudo apt-get remove earlyoom

Uninstall earlyoom And Its Dependencies

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

sudo apt-get -y autoremove earlyoom

Remove earlyoom Configurations and Data

To remove earlyoom configuration and data from Ubuntu 22.04 we can use the following command:

sudo apt-get -y purge earlyoom

Remove earlyoom configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge earlyoom

References

Summary

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