The Android operating system, despite the popularity of the APK format, is technically based on the Linux kernel, so many users are looking for a way to run classic DEB packages, familiar to Debian and Ubuntu distributions. Direct installation of such files into the standard MIUI or One UI shell is impossible, since the architecture of package management systems is radically different. However, by harnessing the power of terminal emulation, you can turn your smartphone into a full-fledged workstation with access to thousands of console utilities.

The key tool to accomplish this task is an app Termuxthat provides a terminal emulation environment without the need for root access. It is within this isolated environment that lives its own package manager, capable of handling dependencies and configuration files, similar to desktop systems. The user needs to understand that work is carried out exclusively on the command line, and there is no familiar graphical installer here.

Before you begin manipulating repositories and commands, it is critical to make sure that you are using the current version of the emulator. Old builds from Google Play often contain outdated libraries, which will lead to compatibility errors when trying to deploy modern software modules. We will look at the process from preparing the environment to resolving typical dependency conflicts.

Preparing a terminal emulator and the base environment

The first step is to correctly install the tool itself. Download Termux either from the F-Droid store or from the official project page on GitHub, since the version on the Play Market is no longer supported by the developers. After launching the application, the system will automatically deploy a minimal file system image where all your data and installed apps will be stored.

Before you start working with packages, you need to update the repository lists and basic utilities to the latest versions. This ensures that you download up-to-date binaries and not outdated versions that may contain critical security vulnerabilities. Enter the update command and wait for the index loading process to complete.

pkg update && pkg upgrade

During the update, the system may request confirmation of actions, to which you should answer in the affirmative by pressing y and the enter key. If the process is interrupted due to a network error, repeat the command - this is normal practice when working with remote mirror servers.

๐Ÿ’ก

Use the "pkg install wget" command immediately after the update to be able to download files directly from the browser or from links in the future.

To fully work with archives and compressed data, you will need to install an additional set of basic tools. Without them, you will not be able to unpack downloaded deb files or check their integrity before installation. Install the package tool-repo and utilities for working with archives.

Mechanisms for working with packages in the Android environment

Inside the ecosystem Termux software management is carried out through utility pkg, which is a wrapper over the standard manager apt. Although it is technically possible to use native dpkg to install local files directly, using high-level managers is preferable due to automatic dependency resolution.

When you try to install a package, the system checks for the presence of all required libraries. If any library is missing, the manager will automatically download and install it before the main package. This is the main difference from manual installation via dpkg -i, where all dependencies will have to be found and installed manually.

๐Ÿ“Š Which installation method do you prefer?
Automatic via pkg
Manual via dpkg
Build from sources
Ready scripts

There are two main approaches to installing software: using official project repositories and installing third-party ones DEB packagesdownloaded from the Internet. The first method is the most stable and secure, the second gives access to a wider range of apps, but requires caution.

To check available packages in the local database, use the search command. You can search for the utility you need by name or part of the name to make sure it is available before attempting to download. This saves traffic and time, eliminating deliberately unsuccessful installation attempts.

pkg search package_name

Step-by-step guide for installing DEB files

The process of installing a local file format .deb requires preliminary preparation of the file in an accessible directory. Most often, files are downloaded to the smartphone's downloads folder, which must be mounted or copied inside the file system Termux to access them from the console.

To provide access to internal storage, run a special permission command. After executing it, a symbolic link to the device memory will appear in the root of the emulator's home directory, through which you can move files.

termux-setup-storage

Attention: the first time you run this command, the system will ask for permission to access the files. You must click "Allow" in the Android system dialog, otherwise the operation will fail with an access error.

After setting up the storage, move the desired one .deb file to the home directory of the terminal or work with it directly along the path to the storage. For direct installation, use the utility dpkg with a flag -iindicating the installation mode.

dpkg -i /sdcard/Download/package_name.deb

If errors about missing dependencies occur during the installation process, do not panic. This is a standard situation for local packages. You can correct the situation with one command, which will force the package manager to download and install all the missing components.

โ˜‘๏ธ Local DEB installation algorithm

Done: 0 / 4

Most modern devices use ARM64, so downloading packages for amd64 (regular PCs) is pointless - they just donโ€™t will start.

Setting up repositories and software sources

Expanding the functionality of the emulator often requires connecting additional software sources. The standard set of repositories is limited to basic utilities, so for specific tasks you have to connect third-party repositories.

The list of active sources is stored in configuration files inside the directory prefix/etc/apt. Editing these files allows you to add new server addresses from where the system will download package indexes when updating.

Repository type Description Risk level
Termux Main Official stable channel Low
Termux X11 Packages for the graphics subsystem Medium
Rootless Utilities that work without superuser rights Low
Unofficial Third-party assemblies from community High

To add a new source, you usually use a command pkg repo or manual editing of lists through a text editor nano. Be extremely careful when entering addresses, as a typo can lead to the package manager not working.

โš ๏ธ Attention: connecting unverified repositories can lead to the installation of malicious code or a conflict between library versions, which will break the operation of the entire emulator.

After changing the list of sources, be sure to update the indexing so that the system knows about new ones available packages. Ignoring this step will result in the search not finding recently added software.

Solving problems with dependencies and conflicts

The most common problem when working with Linux by packages on Android is a conflict between library versions. Different apps may require different versions of the same system library, which leads to the error "unable to correct problems".

To diagnose such situations, use the package integrity check command. It will show which packages are installed incorrectly or have broken dependencies that require user intervention.

apt --fix-broken install

This command is a universal first aid tool. It attempts to automatically resolve conflicts by removing problematic packages or installing missing versions of libraries. In 90% of cases, this solves the problem of unsuccessful installation.

What to do if apt does not help?

If the automatic fix did not work, try removing the problematic package manually using "dpkg -r package_name", and then clear the cache with the "pkg clean" command and repeat the installation.

Sometimes you have to resort to forcing a specific version of a library to be installed, ignoring dependency checks. This should only be done as a last resort and only if you know for sure that this version is compatible with your kernel.

Complicated situations can arise when mixing packages from different distributions (for example, trying to install a package from Debian into the Termux environment). Such actions are strictly not recommended, since the paths to the libraries and the glibc version may not match.

Graphical interface and launching applications

Installing console utilities is only half the battle. Many users want to run graphical Linux applications on their smartphone screen. This requires the installation of a display subsystem, such as Termux:X11 or the use of VNC servers.

After installing the graphics server and the desired application (for example, a text editor geany or browser firefox), the launch occurs through a special command. It initializes the graphical session and redirects the image output to the screen of your device.

The performance of the graphical interface directly depends on the power of the processor and video core of your smartphone. On older devices, animations may be slow, and heavy applications may run with noticeable delays.

โš ๏ธ Warning: running the graphics subsystem significantly increases battery consumption. It is recommended to keep the device connected to a charger during long sessions.

Additional configuration of environment variables may be required to correctly display fonts and encodings in graphics applications. This is especially true for applications that do not have full multilingual support out of the box.

๐Ÿ’ก

Graphical applications in Termux work through the X11 or Wayland layer, so they require installing a separate display server and setting DISPLAY environment variables.

Frequently asked questions (FAQ)

Is it possible to install DEB without Termux?

No, the standard Android shell does not have built-in tools to handle the DEB format. Attempts to install special APK converters often lead to unstable system operation or installation of malware. Termux remains the only safe and functional solution.

Why does it give an architecture error during installation?

You are trying to install a package compiled for a different processor architecture (for example, x86_64 for PC instead of arm64 for phone). Download packages strictly marked arm64 or aarch64.

Is it safe to use root access in Termux?

Using root access in Termux is possible through a plugin termux-su, but this increases security risks. Most problems can be solved in user mode (rootless) without violating the integrity of the Android system.

How to remove an incorrectly installed package?

Use the command pkg uninstall package_name or dpkg -r package_name. If a package interferes with the system and is not removed, you may need to manually remove files from the directory prefix/lib pkg uninstall package_name prefix/bin.

Where are installed DEB packages stored?

The cache of downloaded packages is stored in the directory $PREFIX/var/cache/apt/archives. The installed files themselves are located in a folder structure inside $PREFIX, imitating the standard Linux hierarchy (/bin, /lib, /etc).