Skip to content

Commit d835cb9

Browse files
authored
docs: add new termux installation method (#5938)
* docs: add new termux installation method * fixup: formatting
1 parent 9e9cbd8 commit d835cb9

File tree

1 file changed

+3
-80
lines changed

1 file changed

+3
-80
lines changed

docs/termux.md

+3-80
Original file line numberDiff line numberDiff line change
@@ -12,61 +12,16 @@
1212
- [Create a new user](#create-a-new-user)
1313
- [Install Go](#install-go)
1414
- [Install Python](#install-python)
15-
- [Working with PRoot](#working-with-proot)
1615

1716
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
1817
<!-- prettier-ignore-end -->
1918

2019
## Install
2120

2221
1. Get [Termux](https://f-droid.org/en/packages/com.termux/) from **F-Droid**.
23-
2. Install Debian by running the following:
24-
- Run `termux-setup-storage` to allow storage access, or else code-server won't be able to read from `/sdcard`.\
25-
> The following command is from [proot-distro](https://github.com/termux/proot-distro), but you can also use [Andronix](https://andronix.app/).
26-
> After Debian is installed the `~ $` will change to `root@localhost`.
27-
28-
```bash
29-
pkg update -y && pkg install proot-distro -y && proot-distro install debian && proot-distro login debian
30-
```
31-
32-
3. Run the following commands to setup Debian:
33-
34-
```bash
35-
apt update && apt upgrade -y && apt-get install sudo vim git -y
36-
```
37-
38-
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.
39-
40-
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:
41-
42-
- Copy the lines NVM asks you to run after running the install script.
43-
- Run `nano /root/.bashrc` and comment out those lines by adding a `#` at the start.
44-
- 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.
45-
- Now run `exit`
46-
- Start Debian again `proot-distro login debian`
47-
48-
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:
49-
50-
```bash
51-
nvm install v<major_version_here>
52-
```
53-
54-
7. To install `code-server` run the following:
55-
> To check the install process (Will not actually install code-server)
56-
> If it all looks good, you can install code-server by running the second command
57-
58-
```bash
59-
curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run
60-
```
61-
62-
```bash
63-
curl -fsSL https://code-server.dev/install.sh | sh
64-
```
65-
66-
8. You can now start code server by simply running `code-server`.
67-
68-
> Consider using a new user instead of root, read [here](https://www.howtogeek.com/124950/htg-explains-why-you-shouldnt-log-into-your-linux-system-as-root/) why using root is not recommended.\
69-
> Learn how to add a user [here](#create-a-new-user).
22+
2. Run `pkg install tur-repo`
23+
3. Run `pkg install code-server`
24+
4. You can now start code server by simply running `code-server`.
7025

7126
## NPM Installation
7227

@@ -202,35 +157,3 @@ eval "$(pyenv virtualenv-init -)"
202157
7. Run `touch /root/.pyenv/version && echo "your_version_here" > /root/.pyenv/version`
203158
8. (You may have to start Debian again) Run `python3 -V` to verify if PATH works or not.
204159
> 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`.
205-
206-
### Working with PRoot
207-
208-
Debian PRoot Distro Dev Environment
209-
210-
- 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.
211-
- The terminal accessible in code-server will bring up the filesystem and `~/.bashrc` in the Debian PRoot distro.
212-
213-
Accessing files in the Debian PRoot Distro
214-
215-
- The `/data/data/com.termux/files/home` directory in PRoot accesses the termux home directory (`~`)
216-
- 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)
217-
218-
Accessing the Debian PRoot distro/Starting code-server
219-
220-
- Run the following command to access the Debian PRoot distro, from the termux shell:
221-
222-
```bash
223-
proot-distro login debian
224-
```
225-
226-
- Run the following command to start code-server directly in the Debian PRoot distro, from the termux shell:
227-
228-
```bash
229-
proot-distro login debian -- code-server
230-
```
231-
232-
- 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.
233-
234-
Additional information on PRoot and Termux
235-
236-
- Additional information on using your Debian PRoot Distro can be [found here](https://github.com/termux/proot-distro#functionality-overview).

0 commit comments

Comments
 (0)