How To Install unit-api on CentOS 7

In this tutorial we learn how to install unit-api on CentOS 7. unit-api is JSR 363 - Units of Measurement API

Introduction

In this tutorial we learn how to install unit-api on CentOS 7.

What is unit-api

The Unit of Measurement library provides a set of Java language programming interfaces for handling units and quantities. The interfaces provide a layer which separates client code, which would call the API, from library code, which implements the API. The specification contains Interfaces and abstract classes with methods for unit operations * Checking of unit compatibility * Expression of a quantity in various units * Arithmetic operations on units

We can use yum or dnf to install unit-api on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install unit-api.

Install unit-api on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install unit-api using yum by running the following command:

sudo yum -y install unit-api

Install unit-api on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install unit-api using dnf by running the following command:

sudo dnf -y install unit-api

How To Uninstall unit-api on CentOS 7

To uninstall only the unit-api package we can use the following command:

sudo dnf remove unit-api

References

Summary

In this tutorial we learn how to install unit-api on CentOS 7 using yum and dnf.