Skip to main content

Fix: tar (child): bzip2: Cannot exec: No such file or directory

· One min read
Jagdish Kumawat
Founder @ Dewiride

Encountering tar (child): bzip2: Cannot exec error? This guide covers why it happens during .tar.bz2 extraction and how to fix it by installing bzip2.

Detailed Error Message

$ sudo tar -xjf latest.tar.bz2

tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

Fix

The issue occurs because the system lacks the bzip2 package, which is needed to extract .tar.bz2 files. Here's how to fix it:

  1. Install bzip2: This is likely missing from your system.

    sudo apt update
    sudo apt install bzip2
  2. Retry Extraction: Once bzip2 is installed, you should be able to extract the file:

    sudo tar -xjf latest.tar.bz2

This should solve the issue.

Stay Updated

Subscribe to our newsletter for the latest tutorials, tech insights, and developer news.

By subscribing, you agree to our privacy policy. Unsubscribe at any time.