How To Install cstream on Ubuntu 18.04

In this tutorial we learn how to install cstream on Ubuntu 18.04. cstream is general-purpose stream-handling tool similar to dd

Introduction

In this tutorial we learn how to install cstream on Ubuntu 18.04.

What is cstream

cstream is:

cstream is a general-purpose stream-handling tool like UNIX’ dd, usually used in commandline-constructed pipes.

Features:

  • Sane commandline switch syntax.
  • Exact throughput limiting, on the incoming side. Timing variance in previous reads are counterbalanced in the following reads.
  • Precise throughput reporting. Either at the end of the transmission or everytime SIGUSR1 is received. Quite useful to ask lengthy operations how much data has been transferred yet, i.e. when writing tapes. Reports are done in bytes/sec and if appropriate in KB/sec or MB/sec, where 1K = 1024.
  • SIGUSR2 causes a clean shutdown before EOF on input, timing information is displayed.
  • Build-in support to write its PID to a file, for painless sending of these signals.
  • Build-in support for fifos. Example usage is a ‘pseudo-device’, something that sinks or delivers data at an appropriate rate, but looks like a file, i.e. if you test soundcard software. See the manpage for examples.
  • Built-in data creation and sink, no more redirection of /dev/null and /dev/zero. These special devices speed varies greatly among operating systems, redirecting from it isn’t appropriate benchmarking and a waste of resources anyway.
  • Accepts ‘k’, ’m’ and ‘g’ character after number for “kilo, mega, giga” bytes for overall data size limit.
  • “gcc -Wall” clean source code, serious effort taken to avoid undefined behaviour in ANSI C or POSIX, except long long is required. Limiting and reporting works on data amounts > 4 GB.

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

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

sudo apt-get update

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

sudo apt-get -y install cstream

Install cstream Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install cstream using apt by running the following command:

sudo apt -y install cstream

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

sudo aptitude -y install cstream

How To Uninstall cstream on Ubuntu 18.04

To uninstall only the cstream package we can use the following command:

sudo apt-get remove cstream

Uninstall cstream And Its Dependencies

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

sudo apt-get -y autoremove cstream

Remove cstream Configurations and Data

To remove cstream configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge cstream

Remove cstream configuration, data, and all of its dependencies

We can use the following command to remove cstream configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge cstream

References

Summary

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