Skip to content

Instantly share code, notes, and snippets.

@oschannel
Created December 4, 2021 21:37
Show Gist options
  • Save oschannel/cdcdc16b7ef1b57b61913b582a039333 to your computer and use it in GitHub Desktop.
Save oschannel/cdcdc16b7ef1b57b61913b582a039333 to your computer and use it in GitHub Desktop.
Solved: Termux Repository Under Maintenance or Down

This gist is an answer to the question asked on one of my youtube vids: https://youtu.be/kaCkPTX3p2E

Hadebe Thabang Qtn) So the sources list entry how do you put them on termux?

The termux-change-repo command will automatically edit the entries in sources.list and sources.list.d/* files if you follow the steps from the video tuorial. This 'termux-change-repo' command comes from the termux-tools package, which according to my exp comes pre-installed.

You can check if its available using command dpkg -l | grep termux-tools.

If for some reason you are not able to fix the issue using termux-change-repo command you can try to manually edit the file at $PREFIX/etc/apt/sources.list ($PREFIX is /data/data/com.termux/files/usr on my phone). Make sure you copy/backup the file outside the apt directory before editing it.

Now, to edit the $PREFIX/etc/apt/sources.list you can use vim/nano editor and simply replace the line for main repo with corresponding one from the mirros list. (Mirrors list: https://github.com/termux/termux-packages/wiki/Mirrors)

Worst case scenario, if you do not have vim/nano installed you can simply echo the line corresponding to one of the mirrors using echo command. Example: echo "deb https://termux.mentality.rip/termux-main stable main" > $PREFIX/etc/apt/sources.list

Similarly follow the steps for editing other repos in $PREFIX/etc/apt/sources.list.d/* (ie: backup and edit)

Hope this answers your question and fixes your issue :)

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