How To Install cloud-initramfs-growroot on Ubuntu 18.04

In this tutorial we learn how to install cloud-initramfs-growroot on Ubuntu 18.04. cloud-initramfs-growroot is automatically resize the root partition on first boot

Introduction

In this tutorial we learn how to install cloud-initramfs-growroot on Ubuntu 18.04.

What is cloud-initramfs-growroot

cloud-initramfs-growroot is:

This package adds functionality to an initramfs built by initramfs-tools. When installed, the initramfs will repartition a disk to make the root volume consume all space that follows it.

You most likely do not want this package unless you know what you are doing. It is primarily interesting in a virtualized environment when a disk can provisioned with a size larger than its original size. In this case, with this package installed, you can automatically use the new space without requiring a reboot to re-read the partition table.

There are three methods to install cloud-initramfs-growroot 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 cloud-initramfs-growroot Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install cloud-initramfs-growroot

Install cloud-initramfs-growroot Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install cloud-initramfs-growroot using apt by running the following command:

sudo apt -y install cloud-initramfs-growroot

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

sudo aptitude -y install cloud-initramfs-growroot

How To Uninstall cloud-initramfs-growroot on Ubuntu 18.04

To uninstall only the cloud-initramfs-growroot package we can use the following command:

sudo apt-get remove cloud-initramfs-growroot

Uninstall cloud-initramfs-growroot And Its Dependencies

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

sudo apt-get -y autoremove cloud-initramfs-growroot

Remove cloud-initramfs-growroot Configurations and Data

To remove cloud-initramfs-growroot configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge cloud-initramfs-growroot

Remove cloud-initramfs-growroot configuration, data, and all of its dependencies

We can use the following command to remove cloud-initramfs-growroot configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge cloud-initramfs-growroot

References

Summary

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