strace: command not found – Install Strace Command on CentOS

strace: command not found – How to Install Strace Command on CentOS 7 / RHEL 7 server

Follow the below steps to install Strace Command on your CentOS 7 / Redhat 7 server.

ERROR:

root@server [/]# strace
-bash: strace: command not found

FIX:

Strace command is used on Linux servers for debugging and troubleshooting purposes. On CentOS and Redhat servers, strace command is provided by strace package.

1. First you must log into your Linux server as ‘root’ user

2. Check whether strace rpm package is installed or not using rpm query all command

command :

# rpm -qa | grep strace
 

root@server [/]# rpm -qa | grep strace
root@server [/]#

 
Strace package is not installed on the above Linux server.

3. You can install strace package using yum command.

Command to Install strace package : # yum install strace

Enter ‘y’ and press enter, if yum ask for confirmation while installing strace package.
 

root@server [/]# yum install strace

Resolving Dependencies
–> Running transaction check
—> Package strace.x86_64 0:4.8-11.el7 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Installing:
strace x86_64 4.8-11.el7 base 265 k

Transaction Summary
========================================================================================================================================================================
Install 1 Package

Total download size: 265 k
Installed size: 950 k
Is this ok [y/d/N]: y
Downloading packages:
strace-4.8-11.el7.x86_64.rpm | 265 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : strace-4.8-11.el7.x86_64 1/1
Verifying : strace-4.8-11.el7.x86_64 1/1

Installed:
strace.x86_64 0:4.8-11.el7

Complete!

 
Strace package is installed on the server.
 

Download and install strace rpm on RHEL 7 / CentOS7 server

1. Log into your Linux server as ‘root’ user

2. Download strace from CentOS website using wget command

# wget http://mirror.centos.org/centos/7/os/x86_64/Packages/strace-4.24-4.el7.x86_64.rpm

3. You can install strace package using yum command or rpm command

# yum install strace-4.24-4.el7.x86_64.rpm

The above yum command will install strace package and the required dependencies for the package.

If you are installing using rpm command, you must manually install the required dependencies for the package.

Command to install : # rpm -ivh strace-4.24-4.el7.x86_64.rpm