3

I was trying to install apk files from adb. I used the command adb install <app-name>.apk command. But it returned

/sbin/sh: pm: not found

But if I login to the shell with adb shell and do which pm, it returns

/system/bin/pm

But still I can't install apk using pm. If I do pm install /sdcard/app-name.apk It returns same /sbin/sh: pm: not found error.

whoami returns strange things.

whoami: unknown uid 0

But If I become root and install using pm it works just fine! What could be the problem and How do I solve it?

I'm using a custom ROM (WolfRom v2) on Xperia Sola Phone (2012).

Output of ls -l /system/bin/pm. With root and non-root both returns this result.

# ls -l /system/bin/pm
-rwxr-xr-x root     root          191 2008-08-01 18:00 pm

Running adb shell "/system/bin/pm install /sdcard/app-name.apk" returns same error

/sbin/sh: /system/bin/pm: not found

I also checked the sh's permissions. ls -la /system/bin/sh returns this

lrwxrwxrwx root     root              2016-12-06 12:00 sh -> mksh

Which looks a little unusual. Also ls -la /system/bin/mksh returns this

-rwxr-xr-x root     shell      153344 2008-08-01 18:00 mksh

I've also seen that running mksh instead of sh directly gives a root shell.

  • Looks strange. What custom ROM is it? Have you reported it already to the "ROM bakers" (i.e. at the place where the ROM came from, maybe the corresponding XDA thread)? – Izzy Nov 18 '16 at 14:15
  • @Izzy No. I haven't reported to it and it seems the thread is too old now. You know this phone is old and thus the ROM also. It's WolfRom v2 – Anwar Nov 18 '16 at 15:39
  • Asking doesn't hurt. Some folks may still "watch" the thread – and if the problem lies in the ROM, you won't be the only one having experienced it. Worth trying, I'd say. – Izzy Nov 18 '16 at 16:07
  • What does ls -l /system/bin/pm gives? Run it with root access. – Firelord Nov 18 '16 at 16:28
  • 2
    Thanks for the warm words – and yes, that's one of my goals (and besides it's something that made me feel home here when I started at SE years ago :) Fingers crossed, good luck! – Izzy Nov 18 '16 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.