How to Fix bash: scriptreplay: command not found in Minimal Linux Distributions

The scriptreplay tool is a classic terminal utility included in the standard Linux utility suite that replays typescript recordings made with the script command, complete with original timing information. When attempting to review terminal training sessions or incident logs in stripped-down container images, minimal server builds, or cloud VMs, the shell returns bash: scriptreplay: command not found.

Install the util-linux Package via Distribution Repositories

The scriptreplay binary is distributed as part of the core util-linux suite:

  • Ubuntu and Debian:
    sudo apt update && sudo apt install -y bsdutils util-linux
  • Arch Linux:
    sudo pacman -S util-linux
  • Fedora, CentOS Stream, and RHEL:
    sudo dnf install -y util-linux
  • Alpine Linux:
    sudo apk add util-linux

Verify PATH Resolution and Binary Location

In minimal environments, administrative binaries may reside in directories not registered in a standard non-root user PATH:

  1. Locate the binary location on disk:
    whereis scriptreplay || find /usr -name scriptreplay 2>/dev/null
  2. If located in /usr/bin/scriptreplay, confirm executable permissions:
    ls -l /usr/bin/scriptreplay
  3. Ensure /usr/bin is included in your active shell PATH environment variable:
    echo $PATH

Record and Replay a Terminal Session

Demonstrate proper usage using timing files and output typescripts:

  1. Initiate a recording with timing capture:
    script --timing=timing.log output.log
  2. Perform the terminal commands you wish to document, then type exit to stop logging.
  3. Replay the recorded session in real time:
    scriptreplay --timing=timing.log output.log

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.