I am trying to use python2 bindings for gdal on Ubuntu 20.04 LTS, which does not have the python-gdal package in it's repository, to run an old python2 application.
I tried to download and install it from Ubuntu 18.04 LTS repository:
sudo wget -c http://archive.ubuntu.com/ubuntu/pool/universe/g/gdal/python-gdal_2.2.3+dfsg-2_amd64.deb
sudo apt install ./python-gdal_2.2.3+dfsg-2_amd64.deb
But got the error:
The following packages have unmet dependencies. python-gdal : Depends: gdal-abi-2-2-3 but it is not installable Depends: libgdal20 (>= 2.2.2) but it is not installable E: Unable to correct problems, you have held broken packages.
I also run sudo apt-get dist-upgrade
and apt-cache policy python-gdal libgdal20
with output:
python-gdal: Installed: (none) Candidate: (none) Version table: libgdal20: Installed: (none) Candidate: (none) Version table:
Is there any way to use python-gdal without conflicts to run the app on Ubuntu 20?
Installing GDAL for Python 2 is possible, but we need to get many dependencies manually:
And then pin GDAL package version with single long command below:
Then it should work.