Instructions for installing MADlib and Postgres on Ubuntu 16.04
# Install Postgres 9.6, pl/r and dependencies for MADlib
sudo apt-get install -y cmake postgresql-9.6 postgresql-server-dev-9.6 postgresql-plpython-9.6 postgresql-9.6-plr libkrb5-dev postgresql-client postgresql-contrib
# grab madlib rpm
cd /home/gpadmin/tmp
wget "http://tqyq.datahunter.cn/postgres/apache-madlib-1.12-bin-Linux.rpm"
# install ubuntu package alien
apt-get install -y alien
# convert madlib rpm to deb
alien apache-madlib-1.12-bin-Linux.rpm --scripts
# run deb
dpkg -i apache-madlib-1.12-bin-Linux.deb
# setup username and password
sudo -u postgres psql postgres
\password postgres
\q
# add languages to postgres
sudo -u postgres psql postgres
psql
CREATE EXTENSION plpythonu;
CREATE EXTENSION plr;
\q
# run madpack
/usr/local/madlib/bin/madpack -p postgres -c postgres@localhost:5432/postgres install