pkg update
No mirror or mirror group selected. You might want to select one by running 'termux-change-repo'
Checking availability of current mirror:
[*] https://mirror.vern.cc/termux/termux-main: ok
Reading package lists... Done
E: Could not get lock /data/data/com.termux/files/usr/var/lib/apt/lists/lock. It is held by process 1792 (apt)
N: Be aware that removing the lock file is not a solution and may break your system.
E: Unable to lock directory /data/data/com.termux/files/usr/var/lib/apt/lists/

出现此问题的原因是因为可能是有另外一个程序正在运行,导致资源被锁不可用。而导致资源被锁的原因,可能是上次安装时没正常完成,而导致出现此状况。
只需要根据文件路径将资源删除即可

rm /data/data/com.termux/files/usr/var/lib/apt/lists/lock

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐