In ubuntu 16.04 when I tried to install postgis with using apt-get install postgis postgresql-9.3-postgis-2.1 this command, it installed postgresql 9.6 and postgis-9.6 version. And when tried to create extension it gives error ERROR: could not open extension control file "/usr/share/postgresql/9.3/extension/postgis.control": No such file or directory.
postgres@db:~$ psql
psql (9.6.3, server 9.3.17)
Type "help" for help.