Ways to Uninstall and Install keepalived on Ubuntu 22.04

Updated: September 6, 2022

keepalived is used for monitoring real servers within a Linux Virtual Server (LVS) cluster. keepalived can be configured to remove real servers from the cluster pool if it stops responding, as well as send a notification email to make the admin aware of the service failure. In this guide, I will show you ways to install keepalived Ubuntu 22.04.

Software Requirement

  • OS: Ubuntu 22.04 or older versions with more than 2GB RAM
  • Privileges: Ascertain that you are able to execute sudo commands.

Prerequisites to install keepalived on Ubuntu 22.04

Install keepalived Ubuntu 22.04

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

This is one of the most popular methods for installing Ubuntu packages since it is simple to understand, even if you are a Linux novice. Following these instructions to install keepalived on your Ubuntu.

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. Opening the terminal and executing this Linux command:

sudo apt update

Step 2: Start installing the packages on Ubuntu 22.04. After updating, you can install keepalived Ubuntu by executing this command in the terminal.

sudo apt-get install keepalived

Install keepalived using Aptitude

If you haven’t already installed Aptitude on Ubuntu, run this command to do so.

sudo apt install aptitude

After that, you can now install keepalived by following these steps:

Step 1: You must update the APT package repository cache before attempting to install, update, or remove any packages. Update the APT database to download new packages from Ubuntu. Launching the terminal and entering the following Linux command:

sudo apt-get update

Step 2: Start the package installation on Ubuntu 22.04. After updating the system, you can install keepalived Ubuntu by pasting this command into the terminal and pressing Enter.

sudo aptitude install keepalived

Uninstall keepalived on Ubuntu 22.04

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

You can uninstall keepalived on Ubuntu by running this command if you installed it using APT or Aptitude.

sudo apt remove --auto-remove keepalived

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

sudo apt autoremove --purge keepalived


In this guide, I showed you ways to install keepalived on Ubuntu 22.04 and some ways to uninstall keepalived too. Please do not hesitate to contact me if you require assistance. I’m delighted to respond.