linux, android, terminal, tutorial,

Install Fedora on Termux without Root! CLI Only

Agampreet Singh Agampreet Singh Follow Apr 02, 2022 · 2 mins read
Install Fedora on Termux without Root! CLI Only
Share this

Today, I’ll tell you how to install Fedora Linux on Termux (CLI Only) without Root.
We will use proot-distro for installing Fedora on Termux.

So, Let’s start

  • First, install Termux from F-Droid
  • Now, open Termux and update and install dependencies to run the installation script: pkg update -y; pkg install git wget proot-distro curl wget -y
  • Next, Run this command to install Fedora: proot-distro install fedora (you can run proot-distro help for more info)

And now, Fedora Linux on Termux has been installed! You can login to Fedora using proot-distro login fedora. By default, there will be only root account and as the default user. If you want to create a non-root account, follow these steps:

  • In Fedora, run this command to create a user: adduser username.
  • Next, to set a password for the user, run these two commands:
    1. dnf install passwd (Installs passwd tool)
    2. passwd username. It will ask you for the new password.
    3. Now, to make it a sudo user, edit the sudo file by using visudo, and then find a line which has %wheel ALL=(ALL) ALL and add a line after that accordingly, for example agam7 ALL=(ALL) ALL.
  • To login to the non-root user by default:
    1. In Termux (not Fedora), create a shortcut to login to the non user account - echo proot-distro login --user fedora > fedora; chmod +x fedora
    2. Now, to login, use ./fedora and you will be in the non root account by default!

You might face an error while running commands: /usr/bin/sudo: permission denied etc. To fix this error, run these commands one by one (first login to root from termux using proot-distro login fedora):

  • cd /usr/bin/
  • chmod -R a+x .
  • chmod -R a+r .
  • chmod -R o-w .

And tada! Fedora on Termux has been installed with non root account.

To uninstall, run this command (in Termux):
cd ~; proot-distro remove fedora; rm ./fedora

Note: You cannot use systemd as basically we are in a chroot environment.

Thanks for reading :) You can tell your queries/feedback in the comments section below. Bye 👋

Agampreet Singh
Written by Agampreet Singh Follow
A student who is also a Tech Enthusiast. Founder of this Blog Website