`brew install gdal` errors on GitHub Actions CI (macOS runners)

brew install gdal fails since some time around July 14 with the following error of gfortran conflict. I searched on GitHub with "brew gdal path:.github/workflows", but only to find the same failures. So, I felt it's worth asking here. Anyone knows a proper fix for this?

==> Installing gdal dependency: gcc
==> Pouring gcc-10.1.0.catalina.bottle.tar.gz
##[error]Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/gfortran
Target /usr/local/bin/gfortran
already exists. You may want to remove it:
  rm '/usr/local/bin/gfortran'

To force the link and overwrite all conflicting files:
  brew link --overwrite gcc

To list all files that would be deleted:
  brew link --overwrite --dry-run gcc

Possible conflicting files are:
/usr/local/bin/gfortran -> /usr/local/gfortran/bin/gfortran

c.f. https://github.com/tidyverse/ggplot2/pull/4147

1 Like

Did you try doing as it suggests? e.g. brew link ---overwrite gcc?