How to Install curl in Ubuntu 22.04

“curl” stands for “Client-URL”, which refers to a command-line tool and remote utility used to send and receive data with the help of different protocols such as HTTPS, HTTP, SFTP, SMP, FTP, and many others. In Ubuntu 22.04, curl sends requests or downloads files from the specified URL. Data transportation from one place to another is also the curl command’s primary purpose.

In this post, we will go through the methods to install, use, and remove curl on Ubuntu 22.04.

How to install curl command on Ubuntu 22.04?

On Ubuntu 22.04, to install curl, follow the steps mentioned below.

Step 1: Update the System

First, open the terminal using “CTRL+ALT+T” and update the system packages:

$ sudo apt update

Step 2: Install curl

Install curl on Ubuntu 22.04, using the provided command:

$ sudo apt install curl

As you can see, we have successfully installed the curl command. Let’s move to use it on our Ubuntu 22.04 system.

curl command usage on Ubuntu 22.04

This section will guide you about the usage of the curl command on Ubuntu 22.04.

Example 1: Get and print Home page

To get the HTML code of any website’s home page, use the curl command and add the specific URL. This operation will print out the fetched HTML code on the terminal:

$ curl https://itslinuxfoss.com/

Example 2: Download File

In order to download any file from an online source, use curl along with the source address. Also, the option “-O” will save the file with the actual name:

Example 3: Get Header

Utilize the curl command with the option “-I” and to get the header information of provided URL:

$ curl -I https://itslinuxfoss.com/

Example 4: Get help

To know more about the supported options, execute the “curl” command with the “–help” option in your Ubuntu 22.04 terminal:

$ curl --help

We have gone through some important uses of the curl command. Let’s move toward checking the

How to remove curl from Ubuntu 22.04?

To remove curl from Ubuntu 22.04, run the provided command:

$ sudo apt remove curl -y

We have effectively explained the procedure to install, use, and remove curl on Ubuntu 22.04.

Conclusion

The curl is considered a remote utility of the Ubuntu Operating system. On Ubuntu 22.04, to install curl, first update the system packages. Then, install curl using the “$ sudo apt install curl” command in Ubuntu’s terminal. After doing so, check available options supported by curl and verify the installation by running the “$ curl –help” command on the terminal. In this post, we have effectively explained how to install, use, and remove curl on Ubuntu 22.04.