It appears that Google's libkml does not ship with GDAL 1.9.2 on Ubuntu, specifically gdal-bin 1.9.2-2~precise4:
$ ogrinfo --formats | grep -i kml
-> "KML" (read/write)
To get a version working with libkml and ExtendedData
support, I had to build GDAL from svn trunk (r25473) after building libkml from svn trunk (r864), noting specifically that the 1.2.0 release is apparently not sufficient, as documented on the GDAL website. Beware that installing libkml0
on Ubuntu precise (currently 1.2.0-1ubuntu6) will not help. You really do need 1.3 or svn trunk, for which I was not able to find a PPA.
I was ultimately unable to even build libkml on Ubuntu precise; there are type errors in the version of boost that ships with it, and there are errors running libtool as the dependencies are out of order. For whatever reason, these were not an issue on Debian squeeze, where I did succeed:
$ ogrinfo --formats | grep -i kml
-> "LIBKML" (read/write)
-> "KML" (read/write)
Once I had gotten that going, running ogr2ogr -f "ESRI Shapefile" foo.shp foo.kml
gave me a shapefile that qgis was able to import, preserving the ExtendedData
attributes.