package-troubleshooting
Skill2 starsChanged 57 days agoMITView on GitHub
Diagnose pkg and apt failures on Termux (unable to locate package, stale or wrong mirrors, clock skew, hash mismatch, interrupted dpkg, libraries that fail to link after a partial upgrade) and separate them from build failures. Use when pkg or apt prints an error, when a Debian or Ubuntu package name is missing, or when a command dies with CANNOT LINK EXECUTABLE. Do NOT use to run broad upgrades, change mirrors, or clear caches before capturing the exact error, and do not use for compile errors (see python-native-build).
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- background-processesSkill
- git-credentialsSkill
- github-actionsSkill
- node-native-buildSkill
- proot-boundariesSkill
- python-native-buildSkill
- storage-permissionsSkill
- termux-adbSkill
- termux-apiSkill
- termux-backupSkill
- termux-environmentSkill
- termux-networkSkill
- termux-servicesSkill
- termux-sshdSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
Do not run pkg upgrade, change mirrors, or clear package state before capturing the exact error.
- Very specific: line 37
Never copy Debian or Ubuntu sources.list entries into Termux.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Package Troubleshooting
Purpose
Diagnose package-manager failures without treating every error as a reason to reset repositories or run a broad upgrade.
When to use
pkgoraptfails to resolve, download, verify, or configure a package.- A package name from Debian or Ubuntu does not exist.
- A binary fails with
CANNOT LINK EXECUTABLEor a missing.soafter an upgrade.
When NOT to use
- Compile or wheel failures after the package manager succeeded: use
python-native-buildornode-native-build. - Inside proot: that side has its own
apt; useproot-boundariesfirst. - Do not run
pkg upgrade, change mirrors, or clear package state before capturing the exact error.
Preconditions
Capture, read-only: the full error, the requested package, dpkg --print-architecture, the current date, and free space. sh scripts/check-pkg-state.sh collects these without secrets.
Decision tree
- Native Termux uses
pkg(a wrapper aroundapt). A proot distro uses its ownapt. 1a. Many unrelated failures on an old install: readtermux_apk_releasefrom thetermux-environmenthelper.GOOGLE_PLAY_STOREis the deprecated Play build, which is no longer updated, so packages and repositories may be stale; the supported sources are F-Droid and the GitHub release. Builds from different sources are signed differently and generally cannot be installed over one another, so switching meanstermux-backup, uninstall, reinstall, restore: destructive, so it needs explicit confirmation. Source: the Termux README, checked 2026-10. Release file ... is not valid yetor TLS date errors: the device clock is wrong. Fix the date (automatic time in Android settings) before touching repositories.Unable to locate package: stale indexes, a Debian-style name, or an absent package. Termux package names differ from Debian. Examples:python3-devhas no equivalent (headers ship withpython);libssl-devisopenssl;build-essentialisclang make;libffi-devislibffi. Search withpkg search <word>before concluding it is absent. On native Termux also consider the optional repositories before declaring a package absent:tur-repo(community packages),x11-repo(graphical),root-repo. Enabling one widens trust and needs confirmation; runpkg searchagain afterwards.Hash Sum mismatchor a 404 or timeout from a mirror: the mirror is out of sync or down. Retry once, then consider a different mirror (a confirmed, separate action).dpkg was interrupted,Sub-process dpkg returned an error: preserve the output, then the repair isdpkg --configure -a, a mutating step that needs confirmation.CANNOT LINK EXECUTABLE ... library "lib....so" not found: usually a partial upgrade. Termux does not support partial upgrades; the fix is a completepkg updatefollowed bypkg upgrade, confirmed by the user.No space left on device: check free space;pkg cleanremoves downloaded archives only.- Never copy Debian or Ubuntu
sources.listentries into Termux. Different libc, different paths: it breaks the installation. - Resolution succeeds but compilation fails: hand off.
Example
- Situation: pkg install python3-dev prints Unable to locate package.
- Without the skill: Pastes a Debian sources.list entry into Termux and breaks the installation.
- With the skill: Explains that Termux headers ship inside
python, runspkg search pythonto confirm, and changes no repository.
Safety
pkg install, pkg upgrade, pkg update, mirror changes (termux-change-repo), and dpkg repair all mutate local state and can use large storage or break pinned dependencies. Run read-only status and search first, present each change separately, and get confirmation.
Verification
Re-run the original package query, then check version and path (pkg show <name>, command -v <tool>).
Rollback
Note package versions before changing them (pkg list-installed <name>). Metadata-only changes such as an index refresh need no rollback. For a mirror change, keep the previous sources.list content in the report so it can be restored.
Handoffs
termux-environmentwhen architecture or side is unknown.proot-boundarieswhen the shell may be a proot distro.python-native-buildwhen the package installed but the build failed.termux-networkwhen downloads fail for DNS or TLS reasons.termux-backupbefore a large upgrade on a device that holds irreplaceable state.
Report
The first real error, the layer it belongs to (clock, index, mirror, dpkg state, partial upgrade, space), the change applied, and the verification result.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

