How can I fix "E: Unable to locate package python" in termux? [closed]
Asked Answered
F

9

13

I am installing Python in Termux, but I am getting this error:

pkg install python

Output:

Checking availability of current mirror: ok
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package python
Festination answered 9/12, 2020 at 4:30 Comment(0)
P
19

I think you haven't updated the repository. It looks like you have just installed Termux. Anyway, execute

apt update

and then install any package.

Politics answered 11/12, 2020 at 11:4 Comment(1)
Sorry for the downvote, but the answer on this page to install and use f-droid instead of google play makes sense to solve the error. Unfortunately, your answer is still top.Leafy
C
16

The following combination of answers from this post worked for me:

  1. termux-setup-storage
  2. termux-change-repo (I selected Albatros)
  3. pkg update and pkg upgrade
  4. exit and then restart termux
  5. pkg install python -y
Constabulary answered 13/2, 2022 at 2:32 Comment(1)
Albatros, A1batros, A1batross, or Albatross?Pharmacy
I
14

Termux has halted all updates through Google Play. Download it from F-Droid. Then change the mirror. It works (sometimes).

termux-change-repo

Or change it manually by editing the sources.list file in directory $PREFIX/etc/apt.

Check out my blog post for more links.

Indifference answered 24/6, 2021 at 4:39 Comment(0)
L
7

Download it from F-Droid instead of Google Play.

The link is *https://f-droid.org/en/packages/com.termux/.

Lynch answered 22/1, 2022 at 14:59 Comment(0)
C
3

Make sure you have an Internet connection, and then allow access to your storage.

Run termux-setup-storage. This should ask you for permissions to allow termux to use your device storage.

Then to confirm storage is accessible, run ls ~/storage/shared to list directories contained in shared storage.

If this doesn't work, try switching repositories as some other answers suggest, as the node you're on may be down.

Cornell answered 9/7, 2021 at 19:37 Comment(1)
Hi ruzor and welcome to SO. Maybe you can show in your answer more details about the output of these commands :) . Anyway I think would be nice if you read this: stackoverflow.com/help/how-to-answerTranscurrent
M
1

Try to upgrade your Termux via pkg upgrade. Then it finds the packages on pkg.

Metrical answered 9/10, 2021 at 16:24 Comment(0)
B
1

Only for mobile Termux:

termux-change-repo

There might be services for game and science needed to select all the three options and select the A1batross's options, thereby completing all the permission process steps.

Once done with all these steps, you can install and do operation as a Linux terminal.

PS: update the apt would be better before any other steps

Borsch answered 15/6, 2022 at 12:35 Comment(0)
M
0

I changed my Termux repository to A1batross'.

Mesdames answered 15/7, 2021 at 16:21 Comment(2)
Can you elaborate? It is too close to Albatross to give any meaningful search results. For example, where did you change it? Exactly how did you change it? Does it actually contain the number "1"?Pharmacy
Another answer uses Albatross, not A1batross.Pharmacy
A
-1

Just give storage permissions and restart the application. It worked fine for me.

Aerosphere answered 9/3, 2021 at 18:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.