Skip to content

Bad mirrors are still detected as available #4517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
LostRuins opened this issue Apr 26, 2025 · 3 comments · May be fixed by termux/termux-tools#169
Open

Bad mirrors are still detected as available #4517

LostRuins opened this issue Apr 26, 2025 · 3 comments · May be fixed by termux/termux-tools#169

Comments

@LostRuins
Copy link

Problem description

Sometimes, bad mirrors are still detected as available, and Termux keeps trying to use them by default.

I know we can change mirrors with termux-change-repo, however termux-change-repo is an interactive process and cannot be setup unattended.

I was trying to use pkg install python. Most of the time, it works fine. However, if there is a bad/malicious mirror e.g. https://deb.kcubeterm.me/termux-main (which links to some shady site now) Termux does not recognize this. Depending on your luck, the automatic mirror selection will pick it as a mirror and then you are stuck with that same mirror until manually changed.

Possible Suggestions:

  • If a mirror is defective, "testing the available mirrors" should not list it as "OK".
  • When "Metadata integrity can't be verified, repository is disabled now" due to cybersquatting, actually disable the malicious mirror for that session rather than keep trying to reuse it.
  • Perhaps automatic mirror selection should not be fixed, suggest round robin across the mirror group upon retry?
  • Allow some unattended way of changing a mirror besides the interactive termux-change-repo

Steps to reproduce the behavior.

Install termux
pkg install python

If lucky:

  • all is good

If unlucky and picked the malicious mirror:

  • it will fail. And keep failing, until a human does manual intervention to use termux-change-repo (cannot be automated)

What is the expected behavior?

No response

System information

  • Termux application version: 0.118.0
  • Android OS version: 13
  • Device model: Xperia 5V
@robertkirkman
Copy link

termux-change-repo is an interactive process and cannot be setup unattended.

I have found out that for this type of situation, it is OK to use and recommend this command, which is more scriptable than termux-change-repo but has the same effect.

ln -sf ${PREFIX}/etc/termux/mirrors/default ${PREFIX}/etc/termux/chosen_mirrors

@twaik
Copy link
Member

twaik commented Apr 26, 2025

Probably we should make termux-change-repo work non-interactively as well. It is not the first time people are complaining about this.

@agnostic-apollo
Copy link
Member

Implementing this should solve such bad mirrors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants