LinuxMedium

Fixing 'crontab: command not found' Error in Linux

This article explains why the 'crontab: command not found' error occurs in Linux and provides proven solutions—from installing the cron package to checking the PATH variable.

Updated at February 15, 2026
5-10 min
Easy
FixPedia Team
Применимо к:Ubuntu 20.04/22.04/24.04Debian 11/12CentOS 7/8/Rocky 8/9Fedora 35+

What the 'crontab: command not found' Error Means

The crontab: command not found (or bash: crontab: command not found) error occurs when you try to run the crontab command in a Linux terminal, but the system cannot find its executable file.

This means that the cron (or cronie, vixie-cron) package is not installed on your system, or it is installed but its binary file (/usr/bin/crontab) is not included in your PATH environment variable.

The error typically appears when trying to:

  • View current jobs: crontab -l
  • Edit the job list: crontab -e
  • Set up jobs for another user: crontab -u username -e

Common Causes

  1. The cron package is not installed. This is the most frequent cause. Minimal or specialized Linux installations (e.g., some Docker images, cloud instances) often ship without a job scheduler by default.
  2. The cron package is installed, but crontab is missing from PATH. The package might be installed in a non-standard location, or the user's PATH variable has been modified and no longer includes the /usr/bin directory.
  3. The cron package is installed incorrectly or is corrupted. The /usr/bin/crontab file may have been accidentally deleted or damaged.
  4. The system uses an alternative cron implementation. Some distributions use packages with different names (e.g., cronie), which also provide the crontab command but may have specific installation quirks.
  5. You are working in a restricted environment. For example, in a chroot environment or container where base packages are not installed.

Solutions

Solution 1: Install the cron package (fixes 95% of cases)

This is the primary and simplest solution. Install the cron daemon using your distribution's package manager.

For Debian / Ubuntu and derivatives:

sudo apt update
sudo apt install cron

For RHEL / CentOS / Rocky Linux / AlmaLinux (7 and above):

# For CentOS 7 / RHEL 7
sudo yum install cronie

# For CentOS 8+ / RHEL 8+ / Rocky/Alma 8+
sudo dnf install cronie

Note: In the RHEL family, the main package is usually called cronie.

For Fedora:

sudo dnf install cronie

For Arch Linux:

sudo pacman -S cronie

After installation, verify the command exists:

which crontab
# Expected output: /usr/bin/crontab

💡 Tip: In some minimal installations (especially in containers), the cron package may be installed, but the service is not running by default. After installation, start and enable it:

sudo systemctl enable --now cron   # For Debian/Ubuntu (service name `cron`)
sudo systemctl enable --now crond  # For RHEL/CentOS/Fedora (service name `crond`)

Solution 2: Check and fix the PATH variable

If the cron package is already installed (dpkg -l cron or rpm -qa | grep cron), but the crontab command is not found, the issue is with PATH.

  1. Manually find the full path to crontab:
    find /usr -name crontab 2>/dev/null
    # Typical path: /usr/bin/crontab
    
  2. Temporarily add the path to PATH for the current session:
    export PATH=$PATH:/usr/bin
    crontab -l  # Test if the command now works
    
  3. Make the change permanent by editing your shell configuration: Open your shell's configuration file (usually ~/.bashrc, ~/.bash_profile, or ~/.zshrc for Zsh) and add the line:
    export PATH="$PATH:/usr/bin"
    

    Then apply the changes:
    source ~/.bashrc  # or source ~/.zshrc
    

Solution 3: Check and start the cron service

Sometimes the package is installed, but the cron/crond service is not running, which can cause related issues.

  1. Check the service status:
    systemctl status cron   # For Debian/Ubuntu
    systemctl status crond  # For RHEL/CentOS/Fedora
    
  2. If the service is inactive, start it and enable autostart:
    sudo systemctl start cron   # or crond
    sudo systemctl enable cron  # or crond
    

Solution 4: Reinstall the cron package

If the package is installed but the crontab file is corrupted or missing, reinstall it.

For Debian/Ubuntu:

sudo apt --reinstall install cron

For RHEL/CentOS/Fedora:

sudo dnf reinstall cronie

Solution 5: Use the full path (temporary workaround)

If you cannot or do not want to modify PATH, use the full path to the executable for your commands:

/usr/bin/crontab -l
/usr/bin/crontab -e

This is a temporary fix for specific commands but is inconvenient for daily use.


Prevention

  • Check for cron when provisioning new servers/VMs. Include cron installation in your initialization scripts (e.g., cloud-init or Ansible playbook).
  • Do not remove system packages manually. Always use the package manager (apt remove, dnf remove) to avoid "orphaned" files and dependency issues.
  • Be cautious when editing PATH. Always verify syntax in ~/.bashrc or ~/.profile. An error in these files can prevent any commands from being found.
  • Use absolute paths in system scripts. If you write a script that will be run via cron, use full paths to executables and resources inside the script, as the cron environment has a very minimal PATH (usually /usr/bin:/bin).

F.A.Q.

Why does the 'crontab: command not found' error occur if I just installed cron?
Can I use a task scheduler without the cron package?
How do I check if the cron package is installed on my system?

Hints

Identify your distribution and install the cron package
Verify the crontab command installation
Ensure the cron service is running
Check the PATH environment variable
Reload your shell or session

Did this article help you solve the problem?

FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community