Giter Club home page Giter Club logo

Comments (31)

petkar avatar petkar commented on May 25, 2024

Let me know if the following steps help :

  1. If you installed TermuxArch from this repository, simply do a refresh after updating (git pull). If not run the following commands in termux :
$ git clone https://github.com/TermuxArch/TermuxArch && cd TermuxArch
$ bash setupTermuxArch.sh re

(Run full refresh instead of re if required)

  1. Exit TermuxArch and restart Termux.

  2. Login as a user (which you created using addauser) with the command startarch u <user>

  3. Execute the command bash $HOME/bin/makefakeroot-tcp.bash

from termuxarch.

sobaee avatar sobaee commented on May 25, 2024

@petkar @SDRausty

This picture contains what is the error I faced after successful cloning (git clone https://github.com/TermuxArch/TermuxArch && cd TermuxArch)

Screenshot_20200813213243

N.B: I did "rm -r /root/arch/tmp" and removed this folder but the same error continued.

And the same error occurred when I replaced "r" with "re" or "refresh"

Q: Will everthing work normally when I uninstall TermuxArch by "bash setupTermuxArch.sh purge" and reinstall TermuxArch again with "bash setupTermuxArch.sh"? And will it be updated and ready use?

Also when I use "startarch c addauser user" it gives me this:
/bin/bash: addauser: command not found

Please help?

from termuxarch.

petkar avatar petkar commented on May 25, 2024

I think you just attempted to refresh a TermuxArch proot instance inside a TermuxArch proot environment, hence the error. This must absolutely not be run inside the proot environment but instead, should be cloned and refreshed outside the archlinux proot (in Termux).

from termuxarch.

sobaee avatar sobaee commented on May 25, 2024

@petkar
Okay, This is what I get in Termux itself:
Screenshot_20200813215557

from termuxarch.

petkar avatar petkar commented on May 25, 2024

Try rm -rf TermuxArch and then the same command. Could you also try restarting termux and deleting the directory.

from termuxarch.

sobaee avatar sobaee commented on May 25, 2024

@petkar
Screenshot_20200813215904

N.B: of course termux storage permission is ready from device setting.

from termuxarch.

petkar avatar petkar commented on May 25, 2024

I'm not aware of why the directory isn't being removed due to lack of information but you could just cd into it and run git pull to update it and proceed with the refresh. Note that if you're running re after refresh, you have to exit out of the proot environment.

from termuxarch.

sobaee avatar sobaee commented on May 25, 2024

@petkar
Okay
It asked me define what I want to "pull", this is the result

Screenshot_20200813220911

from termuxarch.

sobaee avatar sobaee commented on May 25, 2024

@petkar
I used these commands in Termux itself and sucessfully updated TermuxArch to 2.0.229

chmod 777 TermuxArch
Then rm -rf TermuxArch
Then git clone https://github.com/TermuxArch/TermuxArch && cd TermuxArch
Then bash setupTermuxArch.sh re

Many thanks

from termuxarch.

sobaee avatar sobaee commented on May 25, 2024

@petkar
Now about the new issue:

Screenshot_20200813222209

I can add users in TermuxArch by other methods like "sudo useradd -m", but you and @SDRausty always advice on creating the user using "addauser" command

from termuxarch.

petkar avatar petkar commented on May 25, 2024

I'm not sure of the version of the local clone. For all sanity purpose try cd ~ && mkdir git-repo && cd git-repo && git clone https://github.com/TermuxArch/TermuxArch && cd TermuxArch && bash setupTermuxArch.sh refresh. This must be executed in termux of course.

from termuxarch.

petkar avatar petkar commented on May 25, 2024

but you and @SDRausty always advice on creating the user using "addauser" command

The addauser command is a script that uses useradd and also performs additional configurations like copying profile information and local binaries and scripts that may be useful, one of which is the makefakeroot-tcp.bash.

from termuxarch.

sobaee avatar sobaee commented on May 25, 2024

I'm not sure of the version of the local clone. For all sanity purpose try cd ~ && mkdir git-repo && cd git-repo && git clone https://github.com/TermuxArch/TermuxArch && cd TermuxArch && bash setupTermuxArch.sh refresh. This must be executed in termux of course.

Should I try to full refresh TermuxArch to use "addauser" command?
Now I already have the latest TermuxArch (2.0.229).

Is there anyway to be able to use "addauser" command wothout full refresh?

from termuxarch.

petkar avatar petkar commented on May 25, 2024

Should I try to full refresh TermuxArch to use "addauser" command?

This is not necessary if you have refreshed to the latest version. Simply run startarch to enter the proot as the root user. Executing addauser user inside the ArchLinux proot should configure the creation of the new user correctly. Setting up passwd user and installing sudo before proceeding to login as the user is recommended. Also, test if sudo is working correctly by using su - user and executing a command with sudo. Later, you can login to the user from termux with the command startarch u user

from termuxarch.

sobaee avatar sobaee commented on May 25, 2024

@petkar
TermuxArch doesn't recognize this command (addauser) at all:
Screenshot_20200813224054

from termuxarch.

petkar avatar petkar commented on May 25, 2024

Does the bin folder exist in the root directory? Is the .profile and .bash_profile sourced? If not, you might have to run refresh and re again.

from termuxarch.

sobaee avatar sobaee commented on May 25, 2024

Executing addauser user inside the ArchLinux proot

After googling this, I think there is something called "Archlinux proot" which I have to set it up before I can use "addauser" command.

By using this after cloning TermuxArch again:
bash setupTermuxArch.sh re ar

Am I right?

from termuxarch.

sobaee avatar sobaee commented on May 25, 2024

Does the bin folder exist in the root directory? Is the .profile and .bash_profile sourced? If not, you might have to run refresh and re again.

How do I know they are out there or not?

Iam a beginner, thank you for your patience.

from termuxarch.

petkar avatar petkar commented on May 25, 2024

How do I know they are out there or not?

ls -la /root should list all the files (including hidden) that exist in the home directory of the root user.

from termuxarch.

sobaee avatar sobaee commented on May 25, 2024

How do I know they are out there or not?

ls -la /root should list all the files (including hidden) that exist in the home directory of the root user.

Then yes I have bin folder and those two files in /root directory.

from termuxarch.

petkar avatar petkar commented on May 25, 2024

Not sure why it isn't in path. Maybe something got messed. A refresh should fix it. However you can directly execute it by calling its full path like /root/bin/addauser username inside the Linux environment with the root user account.

from termuxarch.

sobaee avatar sobaee commented on May 25, 2024

@petkar @SDRausty
I Successfully created a user by addauser and ran this:
bash $HOME/bin/makefakeroot-tcp.bash

Then got this:
Screenshot_20200814002340

N.B: I didn't think that '/bin/makepkg' has been updated, I think this error because I updated '/bin/makepkg' from makepkg.zip file @SDRausty posted here:
SDRausty/TermuxArch#38 (comment)
Why the refresh process of TermuxArch doesn't refresh this file?

I also updated pacman by pacman -S pacman, if this could make any difference?

from termuxarch.

sobaee avatar sobaee commented on May 25, 2024

Yaaaaaaaaaaah 🥳🥳🥳🥳🥳

Successfully installed fakeroot-tcp after spending 2 weeks trying to do it.

The problem was that refershment of TermuxArch copy /bin files to an old user which I created in wrong way (not by addauser)
What I did after referhment and login with my username (by startarch u username), that I run this:
cp /root/bin/* /bin
Which copied the updated files to my correct username, then I ran this:
bash $HOME/bin/makefakeroot-tcp.bash

And everything done and success.

All thank to @petkar and on the first place to @SDRausty.

from termuxarch.

SDRausty avatar SDRausty commented on May 25, 2024

All thank to @petkar and on the first place to @SDRausty.

You are welcome; Many people have contributed to help this project to work as desired on device. You might be surprised @sobaee. You are a contributor to the project now too. Thank you!

from termuxarch.

SDRausty avatar SDRausty commented on May 25, 2024

installed fakeroot-tcp after spending 2 weeks trying to do it.

Have you noticed that makefakeroot-tcp.bash is suddenly broken? It stops at ==> Entering fakeroot environment...! which has a serious effect on makeyay.bash's ability to install and use yay. Do not update your installation if yay is still working properly on your smartphone!

You can help with this if you have enough space on your device by installing a second copy of Arch Linux in an alternate root directory to see if yay still works in a new side by side with the old Arch Linux installation. This can be easily done with setupTermuxArch.bash install customdir. From verbose help with the command: setupTermuxArch.bash h:

[i[nstall] [customdir]] Install Arch Linux in a custom directory. Instructions: Install in userspace. The HOME directory is appended to the installation directory. To install Arch Linux in HOME/customdir use `bash setupTermuxArch.bash install customdir`. In the BASH shell you can use `./setupTermuxArch.bash install customdir`. All options can be abbreviated to one, two and three letters. Hence `./setupTermuxArch.bash install customdir` can be run as `./setupTermuxArch.bash i customdir` in BASH.

I have spent hours trying to figure out why it does not work as desired since yesterday. Maybe you will run into an easy fix with this unlucky situation @sobaee?

from termuxarch.

petkar avatar petkar commented on May 25, 2024

Can confirm, just uninstalled fakeroot-tcp and installed fakeroot instead to test it out and it seems to be breaking at "Entering fakeroot environment" as you said. Will definitely try to determine the cause and troubleshoot the issue.

from termuxarch.

petkar avatar petkar commented on May 25, 2024

I seem to have figured out the problem. Did you happen to change the $PATH variable anytime recently or made any commits that might have indirectly affected the $PATH variable? What I observed is that /usr/bin happens to come before /usr/local/bin in the path variable at the moment and it seems to be calling the makepkg binary present in /usr/bin (which probably isn't working because it got updated and replaced). The modified one (/usr/local/makepkg) isn't being called because it comes after /usr/bin in the PATH variable and the update-proofing seems to be useless now. I'm pretty sure I remember that the /usr/local/bin directory came first earlier (a while ago before the regression) which is also why I suggested copying the systemctl replacement script there too.
A temporary solution was the following :

  • Download the diff.makepkg.zip and unzip it.
  • Obtain the original makepkg binary. This can be done by either reinstalling pacman or running the following command : patch -n -i makepkg.diff -o makepkg /bin/makepkg.<someDATEnumber>.bkp . Note that this might not work if the .old file was overwritten. While the DATE function prevents this, I suggest dropping it for backups as it makes it increasingly difficult to find the backup file. If you don't want to patch the .bkp file because it might be old, reinstalling pacman should suffice. However both the options should work.
  • Purge fakeroot-tcp if it exists. Install fakeroot from pacman.
  • Clone fakeroot-tcp from aur.
  • Open PKGBUILD in an editor and navigate to the prepare() function. You should find the patch part. Prepend sudo to it so that it looks like sudo patch ............
  • Proceed to build fakeroot-tcp using makepkg -si

It should now build correctly. However this is only a workaround. We must still find out why and when the $PATH variable might have changed.

As for the issue with _ADDpatchmakepkg_() { :
Line 584 of archlinuxconfig.bash (6th line in the function) which is patch -n -i makepkg.diff -o makepkg /bin/makepkg might cause issues if it is run more than once because it tries to patch the original binary the first time. On the second or subsequent times, it should be something like patch -n -i makepkg.diff -o makepkg /bin/makepkg.<someDATEnumber.bkp. Now you see why adding DATE might be an issue to pinpoint the file? I'm sure it's still possible to call it using wildcards but makes it complicated.
However, the main cause seems to be the change in the $PATH variable.
Edit : It's 2 am now, so I'll take a break and try to fix the ADDpatchmakepkg and the other functions and submit a pull request tomorrow. Until then, could you investigate if the path variable really did change and if so how? I could also be mistaken, so this could also be my biased assumption (that /usr/local/bin precedes /usr/bin) and take it with a grain of salt.

from termuxarch.

SDRausty avatar SDRausty commented on May 25, 2024

However, the main cause seems to be the change in the $PATH variable.

Yes, you must be correct. I was trying to balance nesting issues, and requests for Termux API commands to be accessible via PATH. I will take a closer look at PATH construction asap. It is in _ADDbash_profile_ currently. PATH can be placed in a number of places, including variable PROOTSTMNT in file knownconfigurations.bash.

from termuxarch.

SDRausty avatar SDRausty commented on May 25, 2024

Your insight and analysis @petkar has brought a solution asap with this b5eaf33 commit; Thank you.

from termuxarch.

petkar avatar petkar commented on May 25, 2024

Glad to hear that it was resolved! I believe the default path (hard coded path for bash in Arch) should look something like this :

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

And in the case of Termux Arch, because of the inclusion of the ~/bin directory in home :

$HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

from termuxarch.

SDRausty avatar SDRausty commented on May 25, 2024

This short fragment printf "%s\\n" "PATH=\"\$HOME/bin:\$PATH:/usr/sbin:/sbin:/bin\"" > root/.bash_profile of code creates;
/root/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/sbin:/sbin:/bin. It is very close to your suggestion. Thank you for sharing @petkar!

from termuxarch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.