Termux-packages: root problem with pkg install

Created on 18 Dec 2019  路  3Comments  路  Source: termux/termux-packages

when i u0_a235
pkg install termux-api
-bash: /data/data/com.termux/files/usr/bin/pkg: Permission denied

when i root

pkg install termux-api

You should not use command 'apt' as root.
This is dangerous as may damage your Termux installation and data.

so i cant use pkg or apt on every user what should i do?

Most helpful comment

Apt is now permanently locked against running as root.

If you use Termux from ADB or other root thing, you need to su back to Termux user in order to install package.

All 3 comments

You have used apt as root at some point which has messed up file permissions.

Easiest fix would be to run rm -rf $PREFIX (as root if necessary) and then restart termux. This will remove all installed packages and give you a fresh installation, but leave $HOME intact

Apt is now permanently locked against running as root.

If you use Termux from ADB or other root thing, you need to su back to Termux user in order to install package.

The error you have -

$ pkg install termux-api
-bash: /data/data/com.termux/files/usr/bin/pkg: Permission denied

comes from messing up with root permissions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bkdwt picture bkdwt  路  3Comments

jackbrycesmith picture jackbrycesmith  路  3Comments

newmania picture newmania  路  3Comments

Wetitpig picture Wetitpig  路  3Comments

StephanBeer picture StephanBeer  路  3Comments