Once it was necessary to compile the newest version of cURL, because there was a bug in the standard version from the Ubuntu Server 20.04 repository, and in the new version it was fixed.
So I switched to the root user and completely removed the installed cURL:
apt purge curl
Installed the required components for building cURL from source:
apt install libssl-dev autoconf libtool make
On the official site https://curl.se/download.html I copied the link to the archive with cURL.
I downloaded it and unpacked it:
rm -rf curl*
You can also download the cURL archive from the master branch:
Changed to the source code directory and installed on the system:
mv /usr/bin/curl /usr/bin/curl.bak
cp /usr/local/bin/curl /usr/bin/curl
Checked the cURL version: