How to fix "E: Unable to locate package python" on termux?

Viewed 89924

I am installing python on termux but I am getting this error:

$ pkg install python
Checking availability of current mirror: ok
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package python
9 Answers

I think you haven't update repo, look like you have just install termux. Anyway, execute

apt update

and then install any package.

termux has haulted all update through google playstore download it from f-droid then change mirror it works (sometime)

termux-change-repo

or change it manually by editing

sources.list

file in directory

$PREFIX/etc/apt

check out my blog post for more link

The combination of the others answers 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

Make sure you have an internet connection, then allow access to your storage;

Run termux-setup-storage, this should ask you for permission to allow termux 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 repos as some other answers suggest, as the node you're on may be down.

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

I changed my termux repository to A1batross's

Only for mobile termux

termux-change-repo

There might be services for game and science need to select all the 3 options and select the A1batross's options there by completes all the permission process steps

Once done with all this steps you can install and do operation as Linux terminal

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

Just give storage permission and restart the app, it worked fine for me.

Related