How To Install strace on Ubuntu 20.04

In this tutorial we learn how to install strace on Ubuntu 20.04. strace is System call tracer System call tracer

Introduction

In this tutorial we learn how to install strace on Ubuntu 20.04.

What is strace

strace is:

strace is a system call tracer, i.e. a debugging tool which prints out a trace of all the system calls made by a another process/program. The program to be traced need not be recompiled for this, so you can use it on binaries for which you don’t have source.

System calls and signals are events that happen at the user/kernel interface. A close examination of this boundary is very useful for bug isolation, sanity checking and attempting to capture race conditions. Task: standard

Package: strace Architecture: amd64 Version: 4.26-0.2ubuntu3 Priority: standard Section: utils Origin: Ubuntu Maintainer: Ubuntu Developers [email protected] Original-Maintainer: Steve McIntyre [email protected] Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 1517 Depends: libc6 (>= 2.15), libunwind8 Filename: pool/main/s/strace/strace_4.26-0.2ubuntu3_amd64.deb Size: 359364 MD5sum: e7e3b760b511bfd069c1b0040f1c2da5 SHA1: a7af4d190ff9aa474037cef512b34a0599de57da SHA256: c6f78cc274cd6ce20befaf40853130e393c1918947d6cc04aed65b94331410bd Homepage: https://strace.io Description-en: System call tracer strace is a system call tracer, i.e. a debugging tool which prints out a trace of all the system calls made by a another process/program. The program to be traced need not be recompiled for this, so you can use it on binaries for which you don’t have source.

System calls and signals are events that happen at the user/kernel interface. A close examination of this boundary is very useful for bug isolation, sanity checking and attempting to capture race conditions. Task: standard

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

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

sudo apt-get update

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

sudo apt-get -y install strace

Install strace Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install strace

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

sudo aptitude -y install strace

How To Uninstall strace on Ubuntu 20.04

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

sudo apt-get remove strace

Uninstall strace And Its Dependencies

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

sudo apt-get -y autoremove strace

Remove strace Configurations and Data

To remove strace configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge strace

Remove strace configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge strace

References

Summary

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