I was finally able to install it more or less cleanly and get it working across the board and hope it will be usefull for others:
Installing GDAL on linux is full of problems and issues - this has resolved some of them for me:
sudo apt install libpq-dev
- problem depedency with libpq5
sudo apt install libpq5=12.2-4
sudo apt install libpq-dev
sudo apt install gdal-bin
sudo apt install libgdal-dev
- problem with LOTS of dependencies
sudo apt install aptitude
- (aptitude can help resolve dependency problems)
sudo aptitude install libgdal-dev
- asks how to resolve issues --> I changed to next reccomendation by pressing "." --> then confirmed by pressing "Y" -->success
after these steps are successfull check if all 3 main libs are installed: "libpq-dev, gdal-bin, libgdal-dev":
apt list --installed | grep "gdal"
result:
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
gdal-bin/focal,now 3.3.2+dfsg-2~focal2 amd64 [installed]
gdal-data/focal,focal,now 3.3.2+dfsg-2~focal2 all [installed,automatic]
libgdal-dev/focal,now 3.3.2+dfsg-2~focal2 amd64 [installed]
libgdal29/focal,now 3.3.2+dfsg-2~focal2 amd64 [installed,automatic]
python3-gdal/focal,now 3.3.2+dfsg-2~focal2 amd64 [installed,automatic]
check gdal version (should be 3.3.2 or higher if all went well):
gdalinfo --version
PYTHON
to install gdal in a python environment should now be possible:
poetry add gdal==3.3.0
or
pip install gdal==3.3.0
by john, this worked 06.07.2022