For those who aren’t familiar, cURL is a software application that enables you to transfer data between two systems using a variety of protocols – including HTTP, FTP, and even email. cURL is often used for web development tasks such as testing website functionality or downloading files from a remote server. However, its capabilities go far beyond that. With a little bit of creativity, cURL can be used to automate a variety of tasks – making it an incredibly useful tool for developers and system administrators alike.
One of the most powerful features of cURL is its ability to execute commands on a remote system. This can be used to trigger scripts or programs on another machine – which can be extremely useful for automating tasks or performing complex actions that would otherwise be difficult to do manually. For example, you could use cURL to automatically download and install updates on a remote server, saving you the hassle of logging in and performing the updates manually.
Of course, cURL can also be used for more mundane tasks – such as simply transferring files between two systems. This can be handy if you need to quickly move a file from one machine to another – without having to go through the hassle of setting up a full-fledged file transfer protocol like FTP. In addition, cURL can be used to download entire websites – which can help create offline backups or mirror sites.
All in all, cURL is an incredibly versatile tool that can save you a lot of time and effort when working with data on multiple systems. Whether you automate tasks or transfer files, cURL is worth learning!
In the following tutorial, you will learn how to install the latest version of the cURL package using a well-known LaunchPAD PPA that provides the latest version for Linux Mint 21 LTS release series using the command line terminal.
Table of Contents
Update Linux Mint
Before proceeding with the tutorial, ensuring your system is up-to-date with all existing packages is good.
sudo apt update && sudo apt upgrade -y
Install Required Packages
The following dependencies will need to be installed to install cURL successfully. Most of these packages are already on your system, but running the command can help ensure they’re installed.
sudo apt install dirmngr ca-certificates software-properties-common gnupg gnupg2 apt-transport-https -y
If you skip and encounter issues, return and just run the command.
As mentioned at the start of the tutorial, cURL comes packaged on Linux Mint/Ubuntu, but you may require a newer version in time.
First, find out what version is installed on your system if you have it already. Users without CURL can skip this.
Example output if cURL is present:
curl --version curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.12 Release-Date: 2022-01-05 Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets zstd
Or, you can install the standard version with the Linux Mint 21 series.
sudo apt install curl -y
Install Latest/Upgrade Existing cURL
First, import the Rob Savoury PPA containing the latest version.
Before importing the GPG key, users will often have issues importing GPG keys from LaunchPAD PPAs due to the directories not being created. This is an easy fix. Use the following command that will, in turn, generate the directories.
sudo gpg --list-keys
As above, the necessary directories have been created. This can be skipped, and use the following GPG import command below. If you have any issues with directories missing for this and any other PPA GPG key in the future, just run the above command.
Use the following command to import the GPG key for the PPA.
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/curl.gpg --keyserver keyserver.ubuntu.com --recv-keys E996735927E427A733BB653E374C7797FB006459
Lastly, import the PPA.
echo 'deb [signed-by=/usr/share/keyrings/curl.gpg] https://ppa.launchpadcontent.net/savoury1/curl34/ubuntu/ jammy main' | sudo tee -a /etc/apt/sources.list.d/curl.list
Next, run an APT update to reflect the newly added PPA.
sudo apt update
Now, an upgrade will appear for users that have previously installed CURL. Still, I would advise just re-run the installation command covering both existing setups and new installations.
Next, verify the version.
curl 7.83.1 (x86_64-pc-linux-gnu) libcurl/7.83.1 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.12 Release-Date: 2022-05-11 Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets zstd
As mentioned above, you have successfully upgraded cURL from 7.81 to 7.83, this will likely grow as the tutorial ages, and newer versions of cURL are released.
How to Update/Upgrade cURL
The most effective method for checking for updates is using the terminal. Even if you have set up automatic updates, run the following command every so often to ensure updates are processed correctly.
sudo apt update && sudo apt upgrade
How to Remove (Uninstall) cURL
For users that wish to revert to the original version of cURL. First, you need to remove the existing package.
sudo apt autoremove curl -y
Next, remove the PPA and GPG you imported if you went this path.
sudo rm /etc/apt/sources.list.d/curl.list /usr/share/keyrings/curl.gpg
Next, run an APT update.
sudo apt update
Now you can re-install cURL if so desired from the default repository.
Comments and Conclusion
If you are looking for a versatile and powerful file transfer tool, curl is worth checking out. Its wide range of supported protocols can be used to download or upload files on just about any server. While the command-line interface may take some time, curl can be a precious asset in your Linux or Unix-based system toolkit once you’ve mastered it.