1、查看系统类型
bash
lsb_release -cs
2、追加资源库列表
bash
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
3、导入资源库的KEY,更新库列表
bash
sudo apt install wget ca-certificates
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update
4、基于安装的postgresql安装pgrouting
bash
sudo apt install postgresql-12-pgrouting
5、安装需要的依赖包,譬如postgresql或者postgis等
bash
sudo apt-get update && sudo apt-get upgrade