Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vi Command Not Found #21

Closed
smu opened this issue Nov 21, 2017 · 12 comments
Closed

vi Command Not Found #21

smu opened this issue Nov 21, 2017 · 12 comments

Comments

@smu
Copy link

smu commented Nov 21, 2017

It tried to install Termux Arch on a chrombook using the latest setupTermuxArch.sh from this git repository. During install the scipt asks whether to use vi or nano for file editing. When I choose vi,
I get the following error message afterwards.

Would you like to run `locale-gen` to generate the en_US.UTF-8 locale or do you want to edit /etc/locale.gen specifying your preferred language before running `locale-gen`?  Answer run or edit [r|e].  e
/data/data/com.termux/files/home/arch/root/bin/finishsetup.sh: line 23: vi: command not found

vi, however, is installed in my termux environment.

$ which vi
/data/data/com.termux/files/usr/bin/vi

I also tried to select nano, this results in a "nano: command not found".

screenshot 2017-11-21 at 20 09 17

@smu
Copy link
Author

smu commented Nov 21, 2017

OK, i understood that this part of the installation is already running inside of the PRoot, and that there is no [vi|nano] in /usr/bin of the arch installation.

@SDRausty
Copy link
Owner

SDRausty commented Nov 22, 2017

@smu Thank you for opening this issue. The script uses Arch components once installed since certain functions need to be performed inside Arch when it is running, like locale-gen and pacman -Syu. Both editors should reside in your Arch installation:

[root@localhost home]# which vi
/usr/bin/vi
[root@localhost home]# l /usr/bin/vi
lrwxrwxrwx 1 root 2 Sep 18  2015 /usr/bin/vi -> ex
[root@localhost home]# which nano
/usr/bin/nano
[root@localhost home]# l /usr/bin/nano
-rwxr-xr-x 1 root 254016 Nov 22 00:59 /usr/bin/nano
[root@localhost home]# ex
[root@localhost home]# vi
[root@localhost home]# nano

You can run Arch Linux in Termux by using startarch even though the system is not configured. Please submit a screenshot of your Arch login with ls -al.

Without an i686 nor a Chromebook, there is still much we can do to help people with this device out. So if you can provide the following, this should help us out:
1 uname -mo
2 getprop ro.product.cpu.abi
3 getprop ro.product.device
4 ls -al ~/arch

Also login to Arch and see which editors are available. Important setupTermuxArch.sh was rewritten to improve Chromebook detection just a couple of days age. Are you using the latest version of setupTermuxArch.sh?

@smu
Copy link
Author

smu commented Nov 22, 2017

Thanks for your reply. Yes, I use a recent version of setupTermuxArch.sh from git (06b7b7f).

vi|nano are not installed within arch (see the attached screenshot).

screenshot 2017-11-22 at 19 42 15

Please find below the requested information:

$ uname -mo
i686 Android
$ getprop ro.product.cpu.abi
x86
$ getprop ro.product.device
cyan_cheets
$ ls -al ~/arch/
total 2036
drwx------ 18 u0_a39 u0_a39    4096 Nov 21 20:31 .
drwx------ 13 u0_a39 u0_a39    4096 Nov 21 20:59 ..
-rw-r--r--  1 u0_a39 u0_a39    1276 Mar  1  2017 README
lrwxrwxrwx  1 u0_a39 u0_a39      18 Dec  6  2016 bin -> usr/bin
drwxr-xr-x  2 u0_a39 u0_a39    4096 Dec  6  2016 boot
drwx------  3 u0_a39 u0_a39    4096 Nov 21 20:31 data
drwxr-xr-x  2 u0_a39 u0_a39    4096 Mar  1  2017 dev
drwxr-xr-x 27 u0_a39 u0_a39    4096 Nov 21 20:42 etc
drwxr-xr-x  2 u0_a39 u0_a39    4096 Dec  6  2016 home
lrwxrwxrwx  1 u0_a39 u0_a39      18 Dec  6  2016 lib -> usr/lib
drwxr-xr-x  2 u0_a39 u0_a39    4096 Dec  6  2016 mnt
drwxr-xr-x  2 u0_a39 u0_a39    4096 Dec  6  2016 opt
dr-xr-xr-x  2 u0_a39 u0_a39    4096 Mar  1  2017 proc
drwxr-x---  4 u0_a39 u0_a39    4096 Nov 21 20:14 root
drwxr-xr-x  2 u0_a39 u0_a39    4096 Mar  1  2017 run
lrwxrwxrwx  1 u0_a39 u0_a39      18 Dec  6  2016 sbin -> usr/bin
drwxr-xr-x  4 u0_a39 u0_a39    4096 Dec  6  2016 srv
-rwx------  1 u0_a39 u0_a39     387 Nov 21 20:08 startarch
d---------  2 u0_a39 u0_a39    4096 Nov 21 20:31 storage
dr-xr-xr-x  2 u0_a39 u0_a39    4096 Mar  1  2017 sys
drwxrwxrwt  2 u0_a39 u0_a39    4096 Nov 21 20:38 tmp
drwxr-xr-x  8 u0_a39 u0_a39    4096 Mar  1  2017 usr
drwxr-xr-x 12 u0_a39 u0_a39    4096 Mar  1  2017 var
-rwx------  1 u0_a39 u0_a39 1902580 Nov 21 20:19 vi

@SDRausty
Copy link
Owner

SDRausty commented Nov 22, 2017

@smu Thank you for your time and quick reply. I have a couple of questions which will hopefully resolve this matter:
1 Is the script still stating, "Detected i686 Android Operating System."? It should be stating, "Detected i686 Chromebook" on your device.
2 Which editors does archlinux-bootstrap-2017.03.01-i686.tar.gz install? Possibly a slightly older image is in order?

A work around might be pacman -S nano vi when i686 is detected, and then running the installed editors. I would prefer to use the editors that come with archlinux-bootstrap-2017.03.01-i686.tar.gz.

Also, where is your default download directory on your Chromebook in Termux? The default directory where your web browser downloads to on Chromebook from the Termux veiwpoint. This information will assist in https://sdrausty.github.io/TermuxArch/docs/install install method #3, "Download from web browser link install".

@smu
Copy link
Author

smu commented Nov 22, 2017

OK, I did a fresh installation with the current git version after deleting the existing arch/ directory.

  1. The installation still states "Detected i686 Android Operating System"

screenshot 2017-11-22 at 20 31 21

  1. As far as I can see, there is not a single editor available in the bootstrab archive. At least no one I know (there are about 600 programs under /usr/bin). The editor is not the only problem. For instance, sed is missing as well, therefore /bin/locale-gen also produces an error during installation.

Regarding the work around. I think the problem is, that the mirrorlist needs to be configured first, before pacman can be used. I solved this by editing the mirrorlist from "outside" (i.e., before entering the PRoot). Still, the bootstrab archive seems to be very limited and I had a number of problems with the archive keys before the installation suceeded.

I do not really now, where the default download directory exists. On a chromebook, there is a download directory in chrome os, which is available in Termux in /data/data/com.termux/files/home/storage/downloads after termux-setup-storage has been executed.
This is the directory, where e.g. chrome running on chrome OS places the downloads.
Moreover, there is a download directory in the home folder (/data/data/com.termux/files/home/downloads).

@SDRausty
Copy link
Owner

SDRausty commented Nov 22, 2017

@smu awesome reply. Thank you.

1 Detection message wants refinement, both
detectsystem2 () and detectsystem2p () in https://raw.githubusercontent.com/sdrausty/TermuxArch/master/scripts/files/necessaryfunctions.sh
2 Editing i686 Arch setup scripts wants editing from within Termux, not Arch. This should migrate to general install. Probably in finishsetup () in https://raw.githubusercontent.com/sdrausty/TermuxArch/master/scripts/files/archsystemconfigs.sh

Regarding downloads directory:
ls -al ~/storage/ result from your Chromebook is requested for more information regarding simplification of https://sdrausty.github.io/TermuxArch/docs/install option 3.

@SDRausty
Copy link
Owner

SDRausty commented Nov 23, 2017

1 This commit 29d52df fixes system detection for Chromebook.
2 This commit b19c64f finishes a series of commits that resolves this issue by relying on Termux for editing of Arch Linux configuration files instead of editors in the newly installed system.

If these modifications do not work for you @smu, please reopen this issue.

@SDRausty
Copy link
Owner

This commit d7e9de5 fixes the system detection message for Chromebook.

@smu
Copy link
Author

smu commented Nov 23, 2017

Thank you. Is tested the bugfix with the recent version from github and can confirm that vim is found now. However, I will report a new issue regarding sed.

@wulvyrn
Copy link

wulvyrn commented Feb 16, 2018

using the latest script as of a few hours ago. vi isn't found. i'm using a chromebook pixelbook. any advice?

@SDRausty
Copy link
Owner

@wulvyrn You shouldn't need vi as it's available in busybox through Termux. Where exactly does vi fail? Can you post some output? To install vim in Arch Linux use pacman -S vim.

@wulvyrn
Copy link

wulvyrn commented Feb 17, 2018

pacman doesn't work as it cannot update. will try and fix that first.

@SDRausty SDRausty changed the title vi: command not found vi Command Not Found Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants