cURL is a tool for transferring data using URLs from the command line. It supports protocols such as HTTP, HTTPS, and FTP, making it useful for web development and server management.

On many Linux systems, including Ubuntu, cURL isn't installed by default, except on Ubuntu Server, where it's commonly used for system administration and advanced tasks. Regular desktop users typically don't need cURL pre-installed.

Installing cURL is straightforward as it's available in default software repositories. Ubuntu users can install it using either the snap or apt package management systems, based on their preference.

Steps to install curl on Ubuntu:

  1. Launch terminal.
  2. Update apt package list.
    $ sudo apt update
    [sudo] password for user:
    Hit:1 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease
    Hit:2 http://ports.ubuntu.com/ubuntu-ports jammy-proposed InRelease    
    Hit:3 http://us.ports.ubuntu.com/ubuntu-ports jammy InRelease          
    Hit:4 http://us.ports.ubuntu.com/ubuntu-ports jammy-updates InRelease
    Hit:5 http://us.ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    All packages are up to date.
  3. Install curl package using apt.
    $ sudo apt install --assume-yes curl
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    The following NEW packages will be installed:
      curl
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 190 kB of archives.
    After this operation, 436 kB of additional disk space will be used.
    Get:1 http://us.ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 curl arm64 7.81.0-1ubuntu1.4 [190 kB]
    Fetched 190 kB in 2s (84.5 kB/s)
    Selecting previously unselected package curl.
    (Reading database ... 206724 files and directories currently installed.)
    Preparing to unpack .../curl_7.81.0-1ubuntu1.4_arm64.deb ...
    Unpacking curl (7.81.0-1ubuntu1.4) ...
    Setting up curl (7.81.0-1ubuntu1.4) ...
    Processing triggers for man-db (2.10.2-1) ...

    Install using snap if that's your preference.

    $ sudo snap install curl
    curl 7.84.0 from Wouter van Bommel (woutervb) installed
  4. Start using curl form the terminal.
    $ curl --help
    Usage: curl [options...] <url>
     -d, --data <data>          HTTP POST data
     -f, --fail                 Fail silently (no output at all) on HTTP errors
     -h, --help <category>      Get help for commands
     -i, --include              Include protocol response headers in the output
     -o, --output <file>        Write to file instead of stdout
     -O, --remote-name          Write output to a file named as the remote file
     -s, --silent               Silent mode
     -T, --upload-file <file>   Transfer local FILE to destination
     -u, --user <user:password> Server user and password
     -A, --user-agent <name>    Send User-Agent <name> to server
     -v, --verbose              Make the operation more talkative
     -V, --version              Show version number and quit
    
    This is not the full help, this menu is stripped into categories.
    Use "--help category" to get an overview of all categories.
    For all options use the manual or "--help all".
Discuss the article:

Comment anonymously. Login not required.