$ apt update
Hit:1 https://termux.net stable InRelease
Reading package lists... Error!
E: Unable to read /data/data/com.termux/files/usr/etc/apt/sources.list.d/ - opendir (13: Permission denied)
W: chmod 0600 of file /data/data/com.termux/files/usr/var/lib/apt/lists/termux.net_dists_stable_InRelease failed - Item::QueueURI (1: Operation not permitted)
W: chmod 0644 of file /data/data/com.termux/files/usr/var/lib/apt/lists/termux.net_dists_stable_InRelease failed - 201::URIDone (1: Operation not permitted)
W: Problem unlinking the file grimler.se_dists_root_InRelease - Clean (13: Permission denied)
W: Problem unlinking the file grimler.se_dists_root_stable_binary-aarch64_Packages - Clean (13: Permission denied)
W: Problem unlinking the file /data/data/com.termux/files/usr/var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /data/data/com.termux/files/usr/var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
E: Problem renaming the file /data/data/com.termux/files/usr/var/cache/apt/srcpkgcache.bin.sC4SaG to /data/data/com.termux/files/usr/var/cache/apt/srcpkgcache.bin - rename (13: Permission denied)
E: Could not open file /data/data/com.termux/files/usr/var/lib/dpkg/status - open (13: Permission denied)
E: Problem opening /data/data/com.termux/files/usr/var/lib/dpkg/status
E: The package lists or status file could not be parsed or opened.
$
Help me please...
Looks like you have run apt as root. You should not do that.
Run rm -rf $PREFIX and restart termux to remove all installed packages (but leave $HOME intact), and then avoid using apt as root.
Oh Grimler.. thank you for your reply...
Do you remember...? You said me to use this command before and it worked...
And yes, I rooted my phone. So now can't I use
sudo apt-get update
sudo apt-get upgrade commands..?
Hey i used it and got lot of errors..
$ rm -rf $PREFIX
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man1/packetforge-ng.1.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man1/wpaclean.1.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man1/kstats.1.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man1/airdecloak-ng.1.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man1/aircrack-ng.1.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man1/makeivs-ng.1.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man1/airdecap-ng.1.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man1/besside-ng-crawler.1.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man1/ivstools.1.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man7/pcilib.7.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man8/nl-qdisc-add.8': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man8/nl-qdisc-list.8': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man8/nl-pktloc-lookup.8': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man8/genl-ctrl-list.8': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man8/nl-qdisc-delete.8': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man8/lspci.8.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man8/setpci.8.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man8/airbase-ng.8.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man8/airmon-ng.8.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man8/airodump-ng.8.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man8/besside-ng.8.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man8/nl-classid-lookup.8': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man8/update-pciids.8.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man8/airtun-ng.8.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man8/airserv-ng.8.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man8/airodump-ng-oui-update.8.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man8/ethtool.8.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man8/iw.8.gz': Permission denied
rm: cannot remove '/data/data/com.termux/files/usr/share/man/man8/airepla
Hey now ls command not working...
$ ls
bash: /data/data/com.termux/files/usr/libexec/termux/command-not-found: No such file or directory
$ ls
bash: /data/data/com.termux/files/usr/libexec/termux/command-not-found: No such file or directory
$
When I open the termux app it's interface is changed and commands not working...
sh: /system/etc/mkshrc[16]: id: not found
@android:/data/data/com.termux/files/home $ ls
sh: ls: not found
127|@android:/data/data/com.termux/files/home $
ls
sh: ls: not found
127|@android:/data/data/com.termux/files/home $
su
sh: su: not found
127|@android:/data/data/com.termux/files/home $
Helppppp
run rm -rf $PREFIX as root if you need to.
Easiest solution at this point might be to uninstall the entire app and then install it again.
You can also run su; rm -rf $PREFIX from a fail-safe session: https://wiki.termux.com/wiki/Recover_a_broken_environment
And yes, I rooted my phone. So now can't I use
sudo apt-get update
sudo apt-get upgrade commands..?
You should never, ever, run apt as root in termux. There's no need for it and it will break stuff as you've learnt.
You should also use pkg instead of apt. It's a wrapper that does apt update automatically and prevents you from running apt as root by mistake
Hey please help.. I used that command but now not workimg any command.
When I open the termux,
sh: /system/etc/mkshrc[9]: getprop: not found
sh: /system/etc/mkshrc[10]: id: not found
@android:/data/data/com.termux/files/home $ ls
sh: ls: not found
127|@android:/data/data/com.termux/files/home $
@MrNobodyTharusha uninstall termux and install it again
may I move the com.termux/files file and replace it after termux reinstalation?