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 runproot-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:
dnf install passwd
(Installs passwd tool)passwd username
. It will ask you for the new password.- 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 exampleagam7 ALL=(ALL) ALL
.
- To login to the non-root user by default:
- In Termux (not Fedora), create a shortcut to login to the non user account -
echo proot-distro login --user fedora > fedora; chmod +x fedora
- Now, to login, use
./fedora
and you will be in the non root account by default!
- In Termux (not Fedora), create a shortcut to login to the non user account -
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 👋