You open Termux, run pkg update, and instead of fresh packages you get a block of red errors ending in something like repository is under maintenance or down. Nothing installs. Despite the wording, a Termux repository under maintenance is rarely the real problem. The message means Termux couldn’t get valid package lists from the mirror it tried. The fix is almost always to point Termux at a working mirror, and this guide shows how.
What the error looks like
The exact text varies, but it usually includes lines like these:
E: The repository 'https://... stable Release' does no longer have a Release file.
N: Metadata integrity can't be verified, repository is disabled now.
N: Possible cause: repository is under maintenance or down (wrong sources.list URL?).
The important part is in brackets: wrong sources.list URL. Your Termux install is pointing at an address that no longer serves packages. That happens when a mirror goes offline, when an old install still points at a repository that has moved, or when your network blocks the mirror.
Fix 1: switch mirrors with termux-change-repo
Termux ships a menu for exactly this:
termux-change-repo
Use the arrow keys and space bar to choose. You can pick a group of mirrors, for example a region close to you, or a single mirror. When pkg runs, it picks from the mirrors you allowed, so choosing a group gives it fallbacks if one goes down. Then refresh and upgrade:
pkg update
pkg upgrade
Termux’s own wiki strongly recommends the full pkg upgrade after changing mirrors, or at least pkg install termux-tools, so the tools that manage repositories are current too. If you’ve added the x11 or root repositories, termux-change-repo lets you change those as well, and you should.
Fix 2: remove the old science and game repos
Older Termux installs often have separate science-repo and game-repo packages. Those channels have since been merged into the main repository, and their old addresses cause errors on every update. If you have them, remove them:
apt remove science-repo game-repo
pkg update
Fix 3: edit sources.list by hand
If termux-change-repo is missing or broken, you can set the mirror yourself. The main repository’s address lives in one file:
nano $PREFIX/etc/apt/sources.list
Comment out the existing line with a # and add a working one. The primary Termux repository line is:
deb https://packages.termux.dev/apt/termux-main stable main
Save with Ctrl+O and exit with Ctrl+X, then run pkg update. Other repositories, such as x11 and root, have their own files in $PREFIX/etc/apt/sources.list.d. You can also run apt edit-sources to open the main file. To see which mirrors you’re using right now, run termux-info.
Fix 4: check your network
If every mirror fails, the problem is probably your connection rather than Termux:
- Open the mirror’s address in your phone’s browser. If it doesn’t load there, Termux can’t reach it either
- Public Wi-Fi with a sign-in page intercepts requests and returns a web page instead of package data. Sign in through the browser first, or switch to mobile data
- Some VPNs, ad blockers and private DNS settings block mirror domains. Turn them off briefly to test
- If your phone’s date and time are wrong, apt can reject package lists as not yet valid. Set them to automatic in Android settings
If Wi-Fi itself is the problem, Android Wi-Fi connected but no internet has fixes for that.
Fix 5: make sure your Termux isn’t too old
A very old Termux build can’t talk to the current repositories at all, however many mirrors you try. This mostly affects the original Google Play version, which stopped receiving updates in 2020. Check where you got Termux. Current builds come from F-Droid, the official GitHub releases, or the newer Google Play release. Don’t mix sources: Termux and its add-ons, such as Termux:API, must all come from the same place. Back up your home folder before reinstalling, because uninstalling Termux deletes it.
After it’s fixed: ‘Unable to locate package’
Once updates work, you may still see Unable to locate package when installing something. That usually means the package lists are stale, so run pkg update first. If it still isn’t found, check the spelling with pkg search, as some packages have different names in Termux than on desktop Linux.
Quick checklist
- Run
termux-change-repoand pick a mirror group near you - Run
pkg updateandpkg upgrade - Remove
science-repoandgame-repoif you have them - If needed, edit
$PREFIX/etc/apt/sources.listby hand - Test the network: captive portals, VPNs, private DNS and the date
- Reinstall from a current source if your Termux is very old
With packages installing again, Termux is ready for real work. If storage access is next on your list, see Termux permission denied on storage, and Claude Code in Termux on Android is a good project to try.

Leave a Reply
You must be logged in to post a comment.