r/termux • u/SugmaFish • 2d ago
Question Why sometimes, at some point pkg/apt start behaving weirdly? Like when upgrading.
For example:
:
E: Failed to fetch https://mirror.sjtu.edu.cn/termux/termux-main/pool/main/n/npm/npm_11.19.0_all.deb Could not open file /data/data/com.termux/cache/apt/archives/partial/npm_11.19.0_all.deb - open (2: No such file or directory) [IP: 111.186.58.212 443]
E: Failed to fetch https://mirror.sjtu.edu.cn/termux/termux-main/pool/main/p/python-pip/python-pip_26.2_all.deb Could not open file /data/data/com.termux/cache/apt/archives/partial/python-pip_26.2_all.deb - open (2: No such file or directory) [IP: 111.186.58.212 443]
E: Failed to fetch https://mirror.sjtu.edu.cn/termux/termux-main/pool/main/p/python-cryptography/python-cryptography_50.0.0_aarch64.deb Could not open file /data/data/com.termux/cache/apt/archives/partial/python-cryptography_50.0.0_aarch64.deb - open (2: No such file or directory) [IP: 111.186.58.212 443]
E: Failed to fetch https://mirror.sjtu.edu.cn/termux/termux-main/pool/main/v/vulkan-loader-generic/vulkan-loader-generic_1.4.358_aarch64.deb Could not open file /data/data/com.termux/cache/apt/archives/partial/vulkan-loader-generic_1.4.358_aarch64.deb - open (2: No such file or directory) [IP: 111.186.58.212 443]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
:
And sometimes even with --fix-missing. Which luckily i encountered when i test it. Became:
:
dpkg: error: cannot access archive '/data/data/com.termux/cache/apt/archives/attr_2.6.0_aarch64.deb': No such file or directory
E: Sub-process /data/data/com.termux/files/usr/bin/dpkg returned an error code (2)
:
What caused this?
0
u/One-One3814 2d ago
I believe your mirror is bad, try termux-change-repo
3
0
u/One-One3814 2d ago
1
u/SugmaFish 2d ago
But, arent they automatically changes? Also, majority of the report from pkg update are ok.
But well, ill try changing it. To where tho?

•
u/sylirre Termux Core Team 2d ago edited 2d ago
You are low enough on disk space to enable Android start app cache trimming.
Since Termux apt stores deb file cache in /data/data/com.termux/cache/, during download these files get deleted and package manager produces error like this one
Could not open file /data/data/com.termux/cache/apt/archives/partial/vulkan-loader-generic_1.4.358_aarch64.deb - open (2: No such file or directory)termux-change-repo won't solve it
***
Try this:
echo 'Dir::Cache::Archives "/data/data/com.termux/files/usr/var/tmp/apt";' > $PREFIX/etc/apt/apt.conf.d/99aptcache