Horizournal logo

Install latest gdal in Debian

Debian 12

Hi , I am writting short steps about how to install latest gdal version in your debian stable.

By the time I am writting this post the default version of gdal available in the stable debian bookworm is 3.6.5 but I want the latest one . Usually gdal will publish the latest release in the unstable source first. if you wanna get your hand on it either you need to install it from the source or you can install it from the unstable source. I will list how to install from unstable source only for the gdal

  1. First update sour package list
 sudo nano /etc/apt/sources.list

Add following line

deb http://deb.debian.org/debian/ unstable main contrib non-free
  1. Update package list
sudo apt update
  1. Now install gdal-bin using unstable source
sudo apt install -t unstable gdal-bin
  1. Check your gdal version
ogrinfo --version

Image description

Hurray !

Install gdal python

if you want python installation of gdal then you can follow following steps :

  • Install gdal dev libraries
sudo apt-get install libgdal-dev
  • Export env variables
export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
  • Now install gdal using pip
pip install gdal==<Version from ogrinfo--version>

You are all set !