Managing packages

Termux ships with a package manager called pkg, and almost everything you add later arrives through it. These questions cover refreshing the index, installing and removing, and the private prefix where all of it lands.

4 questions 1 task Read the lesson

Questions

Each one is marked as you go, and the explanation arrives straight after, which is the part worth reading.

4 questions, marked as you go.

1 What is the difference between pkg update and pkg upgrade?
2 What does the $PREFIX variable point at in Termux?
3 You run pkg list-installed and see a package you do not recognise. Why does the lesson treat that as worth investigating?
4 Why run pkg update before installing something new?

Tasks

These need your own device. Run the command in Termux, then paste what it printed. The marking looks at what the output means, so spacing, version numbers and ordering do not matter. If you have not installed anything yet, the lesson covers the setup.

Show the Termux prefix

This prints the directory Termux installs into, then lists what is inside it. The listing is the standard layout of a Linux install.

Run this in Termux On your own device. Nothing on this page executes it. The command runs in your terminal, and this box only reads what you paste back.

echo $PREFIX; ls $PREFIX
Marking your own work Both halves of this are checked in your browser, with no server involved, so nothing stops you from pasting output you did not run. The tasks are written so that the easiest way to pass one is to actually do it and read the result, which is the whole intention.

All sets Read the lesson