Install PostgreSQL, PostGIS and OpenGeo on Ubuntu 14.04


Actually to install PostgreSQL, PostGIS and OpenGeo we can follow http://suite.opengeo.org/docs/latest/intro/installation/ubuntu/install.html#intro-installation-ubuntu-install.

wget -qO- http://apt.boundlessgeo.com/gpg.key | sudo apt-key add -
echo "deb http://apt.boundlessgeo.com/suite/v45/ubuntu/ trusty main" | sudo tee -a /etc/apt/sources.list.d/opengeo.list
sudo apt-get update
sudo apt-get install opengeo

Fixing libgdal1 Error

Unfortunately, I got an error:

Reading package lists... Done
Building dependency tree 
Reading state information... Done
The following packages were automatically installed and are no longer required:
 libarmadillo4 libarpack2 libbcmail-java libbcpkix-java libboost-thread1.54.0
 libcgal10 libcommons-jexl-java libcommons-lang3-java libdap11 libdapclient3
 libepsilon1 libexcalibur-logger-java libfreexl1 libgdal1h
 libgeronimo-javamail-1.4-spec-java libgeronimo-jms-1.1-spec-java
 libhdf4-0-alt libhdf5-7 libhtmlparser-java libhttpmime-java libjcharts-java
 libjtidy-java libkml0 liblwgeom-2.1.2 liblwgeom-2.1.6 libnetcdfc7 libodbc1
 libogdi3.2 libossp-uuid16 libspatialite5 liburiparser1 libxerces-c3.1
 libxstream-java linux-headers-3.13.0-32 linux-headers-3.13.0-32-generic
 linux-image-3.13.0-32-generic linux-image-extra-3.13.0-32-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
 libgdal opengeo-client opengeo-dashboard opengeo-docs opengeo-server
 opengeo-tomcat7 pgdg-keyring postgis-2.1 postgresql-9.3
 postgresql-9.3-postgis-2.1 postgresql-client-9.3 postgresql-client-common
 postgresql-common
Suggested packages:
 oidentd ident-server locales-all postgresql-doc-9.3
The following NEW packages will be installed:
 libgdal opengeo opengeo-client opengeo-dashboard opengeo-docs opengeo-server
 opengeo-tomcat7 pgdg-keyring postgis-2.1 postgresql-9.3
 postgresql-9.3-postgis-2.1 postgresql-client-9.3 postgresql-client-common
 postgresql-common
0 upgraded, 14 newly installed, 0 to remove and 109 not upgraded.
Need to get 82.6 MB of archives.
After this operation, 222 MB of additional disk space will be used.
...
Preparing to unpack .../libgdal_1.11.1-1+opengeo_amd64.deb ...
Unpacking libgdal (1.11.1-1+opengeo) ...
dpkg: error processing archive /var/cache/apt/archives/libgdal_1.11.1-1+opengeo_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/libgdal.so.1', which is also in package libgdal1h 1.10.1+dfsg-5ubuntu1
Selecting previously unselected package postgis-2.1.
...
Errors were encountered while processing:
 /var/cache/apt/archives/libgdal_1.11.1-1+opengeo_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

The error caused by libgdal1 has duplicate item with different name libgdal1h. So, to fix the error, we can run the following commands:

sudo dpkg -P libgdal1h
sudo apt-get -f install

Voila! Our PostgreSQL, PostGIS and OpenGeo are ready on our machine.

Bonus: Activate PostGIS Shapefile and DBF loader

To access PostGIS Shapefile and DBF loader menu in pgAdmin III, we can edit /usr/share/pgadmin3/plugins.d/plugins.ini file by adding the following lines:

;
; pgShapeLoader (Linux):
;
Title=PostGIS Shapefile and DBF loader
Command=$$PGBINDIR/shp2pgsql-gui -U $$USERNAME -d $$DATABASE -p $$PORT -h $$HOSTNAME
Description=Open a PostGIS ESRI Shapefile or Plain dbf loader console to the current database.
KeyFile=$$PGBINDIR/shp2pgsql-gui
Platform=unix
ServerType=postgresql
Database=Yes
SetPassword=No

APK being Cached after Uninstall App on Android Lollipop


Last time, I got a problem with Nexus 5 with Android Lollipop. I developed an application on the devices and tried uninstalled it. At this point, there was no problem, the app didn’t appear on launcher anymore. But, when I tried to install from Google Play Store, the download process was very fast. The app version was not Google Play Store version, but the developed version. I thought that *.apk was cached somewhere in the device.

Inspect App using ES File Explorer

I uninstalled the app once more. I ran ES File Explorer, open Homepage tab, and click APP.

com.example still appeared after uninstallation
com.example still appeared after I uninstalled it

I saw that our develop version still appear in that list. I tried to open it, but couldn’t. So I checked the Properties of the app. I see that the app already uninstalled.

com.example properties: uninstall button was  already disabled
com.example properties: uninstall button was already disabled

Solutions: Uninstall for all users

Android Lollipop on some devices can have multiple users. On Nexus 5, by default, there are two users (primary user and guest).

Multiple users on Android Lollipop
Multiple users on Android Lollipop

When an app is deployed (by developer) to the device, it will be installed on all users. So, to remove app from all users, in App infoclick on more menu (vertical ellipsis) and then Uninstall for all users.

Uninstall for all users option in App info action bar menu
Uninstall for all users option in App info action bar menu

After this, the app will be removed from your devices. If you reinstall from Google Play Store, it will download the store version.