sudo apt-get install ubuntu-desktop
sudo apt-get install rar unrar scim
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-bin sun-java6-fonts sun-java6-jdk sun-java6-plugin sun-java6-jre
sudo update-alternatives --config java
sudo apt-get install postgresql-9.1 postgis postgresql-9.1-postgis postgresql-server-dev-9.1 postgresql-contrib-9.1 qgis qgis-common pgadmin3 gdal-bin binutils
sudo -u postgres psql postgres
alter user postgres with encrypted password 'new password';
\q
sudo vi /etc/environment
JAVA_HOME="/usr/lib/jvm/java-6-sun"
CATALINA_HOME="/home/yinghua/tools/apache-tomcat-6.0.35"
PATH="$JAVA_HOME/bin:$CATALINA_HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/postgresql/9.1/bin"
:wq
source /etc/environment
sudo -u postgres createdb -E UTF8 template_postgis
sudo -u postgres createlang -d template_postgis plpgsql
sudo -u postgres psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis';"
sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql
sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql
sudo -u postgres psql -d template_postgis -c "grant all on geometry_columns to public;"
sudo -u postgres psql -d template_postgis -c "grant all on geography_columns to public;"
sudo -u postgres psql -d template_postgis -c "grant all on spatial_ref_sys to public;"
sudo -u postgres createdb -T template_postgis mydb
//sudo -u postgres psql -d mydb -f sample.sql
sudo -u postgres psql -f sample.sql mydb
sudo -u postgres psql mydb
select postgis_lib_version();
select postgis_full_version();
select version();
postgis_lib_version
---------------------
1.5.3
(1 row)
postgis_full_version()
----------------------
"POSTGIS="1.5.3" GEOS="3.3.2-CAPI-1.7.2" PROJ="Rel. 4.7.1, 23 September 2009" LIBXML="2.7.8" USE_STATS"
version
---------------------
"PostgreSQL 9.1.3 on x86_64-pc-linux-gnu, compiled by gcc-4.6.real (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1, 64-bit"