Curl is a very popular data transfer command-line utility used for downloading and uploading data from or to the server. It used various network protocols for uploading and downloading data like HTTP, HTTPS, FTP, and SFTP. In this post, we will walk through a step by and easy-to-follow guide on how to install Curl on Debian, Ubuntu, or any Debian-based Operating system. Let’s start.
Installation of Curl Utility on Debian 10
Curl can be installed from the official APT package repository of the Debian 10 Operating system.
First, update the system’s repository cache using the command given below:
Now, upgrade the installed packages as well, using the command provided below:
After successfully updating and upgrading the system. Type the command given below to install the Curl on your Debian 10 system.
The installation of Curl library will start to download, and it will be installed in a moment.
Once the Curl library is installed on your Debian 10 system. Type the command provided below to verify the installation of Curl on your Debian 10 Linux system.
Here you can verify that the curl is successfully and easily installed. Now, you can use the Curl command to your need, and you won’t see any error.
Let’s learn a little bit more about it.
How to use Curl
Curl can be used for many purposes, but we will just go through the basic tasks like getting the source code of any website or downloading a file from the web. Let’s begin with the first thing: how to view the source code.
To view the source code of any website, simply provide the URL in front of the curl command as shown below:
This command will print out the whole source code of the website on the terminal.
Now, let’s see how to download a file using the Curl command. Suppose we have an index.html file at some website www.example.com and we want to download it. To download the index.html file, the Curl command would be like this:
The index.html file will be downloaded in a couple of seconds.
Conclusion
This post is comprised of a solution to an error “curl: command not found”. In this post, we have learned to install Curl on the Debian 10 Operating system, and we have also learned to use it to download a file or view the source code of a website.