Install curl in Ubuntu 22.04

Published: October 14, 2022

Install curl in Ubuntu 22.04

In this article, we cover how to install curl in Ubuntu 22.04 release. cURL stands for Client URL. It was first released in the year 1996. And, at the time of writing the latest stable release is 7.85.0. You would notice that, as on date, v7.81.0 is available through standard Ubuntu repository. If you want specific version of curl then install the package from source (i.e. official website).

curl command-line utility is mainly used to transfer files from or to a server using protocols like HTTP, HTTPS, SCP, SFTP, FTP, DICT etc. It uses libcurl library. libcurl is a client side URL library which supports numerous protocols.

Note: Following operations require superuser privileges. In case you don't have one then, we advise you to contact your System Administrator for assistance.

Install curl in Ubuntu 22.04

Installing curl is pretty easy. The package is already available through standard Ubuntu repository. Therefore, update the repository first. This ensures we get to have the latest version of the package. So, open a terminal and issue the following -

sudo apt update

Next, to install curl -

sudo apt install curl

To verify installation -

curl --version

It would show us the installed package version, release data, supported protocols and features.

We would cover various command-line options of curl in a separate article. For now, it will be about writing curl output to a file. When we don't specify an option, curl writes to standard output (stdout). To write the output to a file, use -o option followed by filename. For instance,

curl -o tp.html "https://techpiezo.com"

We can also Download a file in parts with curl in Ubuntu.

In conclusion, we have covered how to install curl in Ubuntu 22.04 release here.