Resolving the bunzip2 Command Not Found Error During Anaconda Installation
Error Context
When attempting to install Anaconda3 on a minimal Linux server (such as CentOS or RHEL), the installation script may terminate unexpectedly. The process fails during the decompression phase, returning a series of errors indicating that the system cannot locate the required utility to handle the archive.
Anaconda3-5.3.1-Linux-x86_64.sh: line 353: bunzip2: command not found
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
Root Cause Analysis
The installation bundle is compressed using bzip2. The script relies on the bunzip2 utility to decompress the files before extracting them. This utility is part of the bzip2 package. On minimal server installations, this package is often omitted to save space, leading to the 'command not found' error.
Users might intuitively try to install the missing command directly using its name:
yum install bunzip2
However, this results in a failure as no repository provides a package named 'bunzip2':
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
No package bunzip2 available.
Error: Nothing to do
This occurs because bunzip2 is not a standalone package. It is a symbolic link or an alias to the bzip2 executable. Specifically, running bunzip2 is functionally equivalent to executing bzip2 -d.
Solution
To resolve the dependency issue, install the bzip2 package using the package manager.
yum install bzip2
The system will locate the correct package and proceed with the installation:
Resolving Dependencies
--> Running transaction check
---> Package bzip2.x86_64 0:1.0.6-13.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===================================================================================
Package Arch Version Repository Size
===================================================================================
Installing:
bzip2 x86_64 1.0.6-13.el7 base 52 k
Transaction Summary
===================================================================================
Install 1 Package
Total download size: 52 k
Installed size: 82 k
Is this ok [y/d/N]: y
Downloading packages:
bzip2-1.0.6-13.el7.x86_64.rpm | 52 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : bzip2-1.0.6-13.el7.x86_64 1/1
Verifying : bzip2-1.0.6-13.el7.x86_64 1/1
Installed:
bzip2.x86_64 0:1.0.6-13.el7
Complete!
Once the installation is finished, execute the Anaconda shell script again. The installation process will now detect the decompression tool and complete successfully.