The error message bash: line 1: rsync: command not found
indicates that the rsync
command is not installed or not available in your system’s PATH
.
How to Fix This:
1. Install rsync
- On Debian/Ubuntu-based systems:
sudo apt update && sudo apt install rsync -y
- On RHEL/CentOS/Fedora:
sudo yum install rsync # Older RHEL/CentOS sudo dnf install rsync # Fedora/RHEL 8+
- On macOS (if missing, though it’s usually pre-installed):
brew install rsync # Requires Homebrew (https://brew.sh)
- On Alpine Linux:
apk add rsync
2. Verify Installation
After installing, check if rsync
is available:
which rsync
or
rsync --version
3. Check PATH
(If Installation Doesn’t Resolve It)
If rsync
is installed but still not found, ensure it’s in your PATH
:
echo $PATH
If the directory containing rsync
(e.g., /usr/bin
) isn’t listed, add it:
export PATH=$PATH:/usr/bin # Adjust the path if needed
(To make this permanent, add the line to ~/.bashrc
or ~/.bash_profile
.)
4. Re-run Your Command
After installing rsync
, try your original command again.
Let me know if you need further help!