title: Adb install failed invalid location
body: <p>I uninstalled system app, Gallery2(com.android.gallery3d) from my phone and tried installing the app as normal app using </p>
  
  <pre><code>adb install -r /home/risingup/CM12.1/out/target/product/bacon/system/app/Gallery2/Gallery2.apk
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>293 KB/s (5764099 bytes in 19.208s)pkg: /data/local/tmp/Gallery2.apk
  </code></pre>
  
  <p>Failure [INSTALL_FAILED_INVALID_INSTALL_LOCATION]</p>
  
  <p>I tried changing permissions of <code>/data/local/tmp</code> folder but still same error. Please help.</p>
  
  <pre><code>chmod 777 /data /data/local /data/local/tmp
  </code></pre>
  
  <p>which gave</p>
  
  <pre><code>root@A0001:/ # ls -ld data data/local data/local/tmp 
  drwxrwxrwx system   system            2015-08-26 23:20 data
  drwxrwxrwx root     root              2015-08-26 14:33 local
  drwxrwxrwx shell    shell             2015-08-27 00:12 tmp
  </code></pre>
  
  <p>Phone Info:
  Model : One Plus One (A0001)
  Android Version: 5.1.1
  OS : Ubuntu 14.04 x64</p>