GEOS runtime version >= 3.6.1 is currently linking GEOS runtime version: 3.5.1-CAPI-1.9.1 C library with the rgeos library. The most current version, however, is GEOS runtime version: 3.7.2-CAPI-1.11.2. This is yielding the following error when the sf package's st_nearest_feature function is called:

Error in CPL_geos_nearest_feature: GEOS version 3.6.1 required for selecting nearest features

How can we get the latest version of GEOS installed?