Package failures in Termux may come from an obsolete app source, an out-of-sync mirror or mixed plugin channels—not only the network.
Start with the installation source
Keep Termux and its API or Widget plugins on the same source. Do not mix an old Play build with current F-Droid or GitHub plugins.
Low-risk repair order
pkg update
pkg upgrade
termux-change-repoRefresh indexes first. Change mirrors only for persistent 404 or Release-file errors. For signature errors, verify the device clock before considering anything drastic.
Leave a useful record
Record the step that actually fixed it, the device or browser version, and any temporary changes you reverted. That note is often more useful than another bookmark.