How To Install ohai on Ubuntu 20.04
Introduction
In this tutorial we learn how to install ohai on Ubuntu 20.04.
What is ohai
ohai is:
Information about your system is collected and returned as multidimensional attributes in JSON format. The following information is captured:
- Operating system and kernel
- Filesystems in use
- Network configuration and statistics
- Available languages
- Virtualization Ruby-Versions: all
There are three methods to install ohai on Ubuntu 20.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 ohai Using apt-get
Update apt database with apt-get using the following command.
sudo apt-get update
After updating apt database, We can install ohai using apt-get by running the following command:
sudo apt-get -y install ohai
Install ohai Using apt
Update apt database with apt using the following command.
sudo apt update
After updating apt database, We can install ohai using apt by running the following command:
sudo apt -y install ohai
Install ohai 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 ohai using aptitude by running the following command:
sudo aptitude -y install ohai
How To Uninstall ohai on Ubuntu 20.04
To uninstall only the ohai package we can use the following command:
sudo apt-get remove ohai
Uninstall ohai And Its Dependencies
To uninstall ohai and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:
sudo apt-get -y autoremove ohai
Remove ohai Configurations and Data
To remove ohai configuration and data from Ubuntu 20.04 we can use the following command:
sudo apt-get -y purge ohai
Remove ohai configuration, data, and all of its dependencies
We can use the following command to remove ohai configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge ohai
References
Summary
In this tutorial we learn how to install ohai package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.