How To Install libboost-chrono1.71.0 on Ubuntu 20.04
Introduction
In this tutorial we learn how to install libboost-chrono1.71.0
on Ubuntu 20.04.
What is libboost-chrono1.71.0
libboost-chrono1.71.0 is:
This package forms part of the Boost C++ Libraries collection.
The Boost.Chrono library provides:
- A means to represent time durations: managed by the generic duration class.Examples of time durations include days, minutes, seconds and nanoseconds, which can be represented with a fixed number of clock ticks per unit. All of these units of time duration are united with a generic interface by the duration facility.
- A type for representing points in time: time_point. A time_point represents an epoch plus or minus a duration. The library leaves epochs unspecified. A time_point is associated with a clock.
- Several clocks, some of which may not be available on a particular platform: system_clock, steady_clock and high_resolution_clock. A clock is a pairing of a time_point and duration, and a function which returns a time_point representing now.
To make the timing facilities more generally useful, Boost.Chrono provides a number of clocks that are thin wrappers around the operating system’s time APIs, thereby allowing the extraction of wall clock time, user CPU time, system CPU time spent by the process:
- process_real_cpu_clock, captures wall clock CPU time spent by the current process.
- process_user_cpu_clock, captures user-CPU time spent by the current process.
- process_system_cpu_clock, captures system-CPU time spent by the current process.
- a tuple-like class process_cpu_clock, that captures real, user-CPU, and system-CPU process times together.
- a thread_clock thread steady clock giving the time spent by the current thread (when supported by a platform).
Lastly, Boost.Chrono includes typeof registration for duration and time_point to permit using emulated auto with C++03 compilers.
There are three methods to install libboost-chrono1.71.0
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 libboost-chrono1.71.0 Using apt-get
Update apt database with apt-get
using the following command.
sudo apt-get update
After updating apt database, We can install libboost-chrono1.71.0
using apt-get
by running the following command:
sudo apt-get -y install libboost-chrono1.71.0
Install libboost-chrono1.71.0 Using apt
Update apt database with apt
using the following command.
sudo apt update
After updating apt database, We can install libboost-chrono1.71.0
using apt
by running the following command:
sudo apt -y install libboost-chrono1.71.0
Install libboost-chrono1.71.0 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 libboost-chrono1.71.0
using aptitude
by running the following command:
sudo aptitude -y install libboost-chrono1.71.0
How To Uninstall libboost-chrono1.71.0 on Ubuntu 20.04
To uninstall only the libboost-chrono1.71.0
package we can use the following command:
sudo apt-get remove libboost-chrono1.71.0
Uninstall libboost-chrono1.71.0 And Its Dependencies
To uninstall libboost-chrono1.71.0
and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:
sudo apt-get -y autoremove libboost-chrono1.71.0
Remove libboost-chrono1.71.0 Configurations and Data
To remove libboost-chrono1.71.0
configuration and data from Ubuntu 20.04 we can use the following command:
sudo apt-get -y purge libboost-chrono1.71.0
Remove libboost-chrono1.71.0 configuration, data, and all of its dependencies
We can use the following command to remove libboost-chrono1.71.0
configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge libboost-chrono1.71.0
References
Summary
In this tutorial we learn how to install libboost-chrono1.71.0
package on Ubuntu 20.04 using different package management tools: apt
, apt-get
and aptitude
.