How to Fix the Error “bash: curl: command not found”

In this guide will explain the meaning of this problem “bash: curl: command not found” and show you how to install the curl command in order to solve it on all major Linux variants.

You’re not alone if you’ve ever seen the error message “bash: curl: command not found” or “bash: /usr/bin/curl: No such file or directory” when using Linux. When you try to use the curl command in the terminal and the system is unable to locate it, this error frequently appears.

Issue

Let’s start by understanding that “curl” is a useful command-line utility for downloading files, requesting things from APIs, and more. It transfers data to and from a server.

However, you’ll encounter an error message like this if your system doesn’t recognize the ‘curl’ command:

The most frequent cause of this problem is because your Linux system does not have “curl” installed. In contrast to certain other commands that are pre-installed, “curl” may require further installation.

Installing CURL package

Use the proper command for your particular Linux distribution to install curl on Linux.

For Ubuntu & Debian based system

For RHEL, Rocky Linux, CentOS, AlmaLinux

On OpenSUSE

After curl is installed, use the following command on your terminal to confirm the version.

It is possible that “curl” is not in your system’s PATH if it is installed but is still not recognized. A list of folders that the system searches for executable files is called the PATH.

You may run the below command to see if “curl” is present in the PATH.

You can add it to the PATH in your shell profile file (such as ‘.bashrc‘ or ‘.bash_profile‘).

Remember to execute the following command or restart your terminal in order for the modifications to take effect.

Conclusion

Linux users frequently run into the “bash: curl: command not found” error, however this is a simple fix that can be fixed by installing curl or making sure it is in your system’s PATH.

Linux offers customization and flexibility, and knowing how to solve these problems helps users get the most out of their systems. So don’t worry the next time you notice this problem; you have the skills to remedy it!

For more options in CUEL you may also refer command line tool and library

You may also like : How to Install Rocky Linux 8

Leave a comment