ERROR: could not open extension control file “/usr/share/postgresql/9.3/extension/plr.control”: No such file or directory

Problem

You are trying to install the PL/R extension to PostgreSQL, after install R in your linux ubuntu development environment, but when trying to install the extension inside your PostgresSQL with:

create extension plr;

you are getting the following error:

ERROR:  could not open extension control file "/usr/share/postgresql/9.3/extension/plr.control": No such file or directory

Solution

Install the necessary package for your PostgreSQL version with the following, and install the extension in your psql:

sudo apt-get install postgresql-9.x-plr