You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: simplify termux installation process (#5078)
* Update termux.md
1) Updated information to use PRoot (simpler than Andronix and the way supported by Termux) to create and access the Debian distro.
2) Added helpful information on using PRoot with your dev environment.
3) Cleaned up spelling, grammar, and made documentation more consistent between sections.
* docs: Termux correct packages to install
Updated some erroneously missing packages (vim and sudo) necessary for multi-user setup.
* docs: cleaned up verbiage
Co-authored-by: Joe Previte <[email protected]>
* docs: corrected punctuation
Co-authored-by: Joe Previte <[email protected]>
* docs: correct punctuation
Co-authored-by: Joe Previte <[email protected]>
* docs: clarify pkg command shorthand
* Ran yarn fmt on docs
Co-authored-by: Joe Previte <[email protected]>
Copy file name to clipboardExpand all lines: docs/termux.md
+61-24
Original file line number
Diff line number
Diff line change
@@ -10,40 +10,45 @@
10
10
-[Create a new user](#create-a-new-user)
11
11
-[Install Go](#install-go)
12
12
-[Install Python](#install-python)
13
+
-[Working with PRoot](#working-with-proot)
13
14
14
15
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
15
16
16
17
## Install
17
18
18
19
1. Get [Termux](https://f-droid.org/en/packages/com.termux/) from **F-Droid**.
19
-
2. Install Debian by running the following.
20
+
2. Install Debian by running the following:
20
21
- Run `termux-setup-storage` to allow storage access, or else code-server won't be able to read from `/sdcard`.\
21
-
If you used the Andronix command then you may have to edit the `start-debian.sh` script to mount `/sdcard` just as simple as uncommenting the `command+=" -b /sdcard"` line.
22
-
> The following command was extracted from [Andronix](https://andronix.app/) you can also use [proot-distro](https://github.com/termux/proot-distro).
22
+
> The following command is from [proot-distro](https://github.com/termux/proot-distro), but you can also use [Andronix](https://andronix.app/).
23
23
> After Debian is installed the `~ $` will change to `root@localhost`.
4. Install [NVM](https://github.com/nvm-sh/nvm) by following the install guide in the README, just a curl/wget command.
38
-
5. Set up NVM for multi-user. After installing NVM it automatically adds the necessary commands for it to work, but it will only work if you are logged in as root;
35
+
4. Install [NVM](https://github.com/nvm-sh/nvm#install--update-script) by following the install guide in the README, just a curl/wget command.
36
+
37
+
5. Set up NVM for multi-user. After installing NVM it automatically adds the necessary commands for it to work, but it will only work if you are logged in as root:
39
38
40
39
- Copy the lines NVM asks you to run after running the install script.
41
40
- Run `nano /root/.bashrc` and comment out those lines by adding a `#` at the start.
42
-
- Run `nano /etc/profile` and paste those lines at the end and make sure to replace `$HOME` with `/root`
43
-
- Now run `exit` and start Debain again.
41
+
- Run `nano /etc/profile` and paste those lines at the end of the file. Make sure to replace `$HOME` with `/root` on the first line.
42
+
- Now run `exit`
43
+
- Start Debian again `proot-distro login debian`
44
+
45
+
6. After following the instructions and setting up NVM you can now install the [required node version](https://coder.com/docs/code-server/latest/npm#nodejs-version) by running:
46
+
47
+
```bash
48
+
nvm install v<major_version_here>
49
+
```
44
50
45
-
6. After following the instructions and setting up NVM you can now install the [required node version](https://coder.com/docs/code-server/latest/npm#nodejs-version) using `nvm install version_here`.
46
-
7. To install `code-server` run the following.
51
+
7. To install `code-server` run the following:
47
52
> To check the install process (Will not actually install code-server)
48
53
> If it all looks good, you can install code-server by running the second command
49
54
@@ -82,11 +87,11 @@ Potential Workaround :
82
87
83
88
To create a new user follow these simple steps -
84
89
85
-
1. Create a new user by running `useradd username -m`.
86
-
2. Change the password by running `passwd username`.
87
-
3. Give your new user sudo access by runnning`visudo`, scroll down to `User privilege specification` and add the following line after root `username ALL=(ALL:ALL) ALL`.
88
-
4. Now edit the `/etc/passwd` file with your commadline editor of choice and at the end of the line that specifies your user change `/bin/sh` to `/bin/bash`.
89
-
5. Now switch users, by running `su - username`
90
+
1. Create a new user by running `useradd <username> -m`.
91
+
2. Change the password by running `passwd <username>`.
92
+
3. Give your new user sudo access by running`visudo`, scroll down to `User privilege specification` and add the following line after root `username ALL=(ALL:ALL) ALL`.
93
+
4. Now edit the `/etc/passwd` file with your command line editor of choice and at the end of the line that specifies your user change `/bin/sh` to `/bin/bash`.
94
+
5. Now switch users by running `su - <username>`
90
95
91
96
- Remember the `-` betweeen `su` and username is required to execute `/etc/profile`,\
92
97
since `/etc/profile` may have some necessary things to be executed you should always add a `-`.
@@ -95,7 +100,7 @@ To create a new user follow these simple steps -
95
100
96
101
> From https://golang.org/doc/install
97
102
98
-
1. Go to https://golang.org/dl/ and copy the download link for `linux arm` and run the following.
103
+
1. Go to https://golang.org/dl/ and copy the download link for `linux arm` and run the following:
5. Run `pyenv versions` to list all installable versions.
144
149
6. Run `pyenv install version` to install the desired python version.
145
150
> The build process may take some time (an hour or 2 depending on your device).
146
151
7. Run `touch /root/.pyenv/version && echo "your_version_here" > /root/.pyenv/version`
147
152
8. (You may have to start Debian again) Run `python3 -V` to verify if PATH works or not.
148
153
> If `python3` doesn't work but pyenv says that the install was successful in step 6 then try running `$PYENV_ROOT/versions/your_version/bin/python3`.
154
+
155
+
### Working with PRoot
156
+
157
+
Debian PRoot Distro Dev Environment
158
+
159
+
- Since Node and code-server are installed in the Debian PRoot distro, your `~/.ssh/` configuration, `~/.bashrc`, git, npm packages, etc. should be setup in PRoot as well.
160
+
- The terminal accessible in code-server will bring up the filesystem and `~/.bashrc` in the Debian PRoot distro.
161
+
162
+
Accessing files in the Debian PRoot Distro
163
+
164
+
- The `/data/data/com.termux/files/home` directory in PRoot accesses the termux home directory (`~`)
165
+
- The `/sdcard` directory in PRoot accesses the Android storage directory, though there are [known issues with git and files in the `/sdcard` path](#git-wont-work-in-sdcard)
166
+
167
+
Accessing the Debian PRoot distro/Starting code-server
168
+
169
+
- Run the following command to access the Debian PRoot distro, from the termux shell:
170
+
171
+
```bash
172
+
proot-distro login debian
173
+
```
174
+
175
+
- Run the following command to start code-server directly in the Debian PRoot distro, from the termux shell:
176
+
177
+
```bash
178
+
proot-distro login debian -- code-server
179
+
```
180
+
181
+
- If you [created a new user](#create-a-new-user), you'll need to insert the `--user <username>` option between `login` and `debian` in the commands above to run as the user instead of root in PRoot.
182
+
183
+
Additional information on PRoot and Termux
184
+
185
+
- Additional information on using your Debian PRoot Distro can be [found here](https://github.com/termux/proot-distro#functionality-overview).
0 commit comments