PostgreSQL 12 and PostGIS 3.0.1: ERROR: could not access file "$libdir/postgis-3": No such file or directory on Linux
Welcome to SO.
You were close. Try installing postgis
in your PostgreSQL 12 like this:
sudo apt-get install postgresql-12-postgis-3
After that you'll be able to successfully run
CREATE EXTENSION postgis;
On Arch Linux you need to install postgis-old-upgrade
alongside postgresql-old-upgrade
.