When I try to install libcurl4-dev it says that this is a virtual
package and I need to install libcurl4-gnutls-dev or libcurl4-nss-dev.
What is the difference between installing one or the other?
Both provide the same functionality, just using different libraries.
cURL supports the use of Transport Layer Security (TLS, aka SSL) for data transfers. Since implementing TLS is quite tricky, cURL delegates this to an external library. cURL supports several different libraries for this purpose, and you need to select one when building it (see how to install curl and libcurl, section "Select TLS backend"). The most popular options to use as the TLS library are:
Which one you choose depends on several factors (licensing, performance, exact feature set, such as supported crypto algorithms...), but they all mostly provide the same functionality.
Ubuntu wants to allow people to choose which variant of cURL they want to use, so they build cURL againts different TLS libraries, and offer them as separate packages. As of
Ubuntu bionic (18.04LTS), the variants are:
So, install the right variant for the TLS library you want to use. If you have no particular preference, install the default variant (which uses OpenSSL).