Skip to content

Instantly share code, notes, and snippets.

@hawkeye64
Last active May 24, 2018 16:54
Show Gist options
  • Save hawkeye64/8159c8ba07e7d11bf7a8a837e94fedbb to your computer and use it in GitHub Desktop.
Save hawkeye64/8159c8ba07e7d11bf7a8a837e94fedbb to your computer and use it in GitHub Desktop.
Upgrade Postgresql 9.6 to 10.4 on Ubuntu 17.10 with Python support
mkdir sql
cd sql
sudo -u postgres pg_dumpall > backup.sql
sudo service postgresql stop
sudo apt remove postgresql
sudo apt remove postgresql-9.6 postgresql-client-9.6 postgresql-client-common postgresql-common postgresql-contrib postgresql-contrib-9.6 postgresql-plpython3-9.6
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update
sudo apt upgrade
wget http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu55_55.1-7ubuntu0.4_amd64.deb
sudo dpkg -i ./libicu55_55.1-7ubuntu0.4_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/main/p/python3.5/libpython3.5-minimal_3.5.2-2ubuntu0~16.04.4_amd64.deb
sudo dpkg -i ./libpython3.5-minimal_3.5.2-2ubuntu0~16.04.4_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/main/p/python3.5/libpython3.5-stdlib_3.5.2-2ubuntu0~16.04.4_amd64.deb
sudo dpkg -i ./libpython3.5-stdlib_3.5.2-2ubuntu0~16.04.4_amd64.deb
sudo apt --fix-broken install
sudo apt install postgresql-10 postgresql-client-10 postgresql-contrib-10 postgresql-plpython3-10 postgresql-10-pgaudit
sudo service postgresql start
sudo -u postgres psql postgres -f backup.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment