I am trying to install GDAL in Ubuntu 18.04 with the following commands
sudo add-apt-repository -y ppa:ubuntugis/ppa
sudo apt update
sudo apt install gdal-bin python-gdal python3-gdal
But it returning the following error
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
gdal-bin : Depends: gdal-abi-2-4-0
Depends: libgdal20 (>= 2.4.0) but it is not going to be installed
python-gdal : Depends: python-numpy (>= 1:1.13.1) but it is not installable
Depends: python-numpy-abi9 but it is not installable
Depends: gdal-abi-2-4-0
Depends: libgdal20 (>= 2.4.0) but it is not going to be installed
python3-gdal : Depends: python3-numpy (>= 1:1.13.1) but it is not installable
Depends: python3-numpy-abi9 but it is not installable
Depends: gdal-abi-2-4-0
Depends: libgdal20 (>= 2.4.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Best Answer
I recently started using a ubuntu-based container: image 18.04 (server) and standard package repository in apt's sources.list.
After running this container and searching for packages using the standard commands:
apt-get update
apt-cache search
I found GDAL and Python GDAL as results for the following commands:
apt-cache search gdal | grep -i ogr
apt-cache search gdal |grep -i python
Next, I installed the related GDAL
apt-get install gdal-bin
package and tested the following command to import a GeoJSON into a PostGIS database.I haven't tested the Python package to see if it's working, but the installation went without errors.
apt-get install python3-gdal
Additional information about O.S.
Command output
cat /etc/os-release