Skip to content

Commit 6172acd

Browse files
committed
Fix : replace unnecessary steps to be linked to a guide
1 parent ba0a6c9 commit 6172acd

File tree

1 file changed

+24
-37
lines changed

1 file changed

+24
-37
lines changed

docs/termux.md

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,78 +7,66 @@
77
- [Known Issues](#known-issues)
88
- [Git won't work in `/sdcard`](#git-wont-work-in-sdcard)
99
- [Extra](#extra)
10-
- [Install GO](#install-go)
10+
- [Install Go](#install-go)
1111
- [Install Python](#install-python)
1212

1313
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
1414

15-
### Install
15+
## Install
1616

1717
1. Get [Termux](https://f-droid.org/en/packages/com.termux/) from **F-Droid**.
18-
2. Install Debian by running the following. - Run `termux-setup-storage` to allow storage access, or else code-server won't be able to read from `/sdcard`.\
19-
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.
20-
> The following command was extracted from [Andronix](https://andronix.app/) you can also use [proot-distro](https://github.com/termux/proot-distro).
18+
2. Install Debian by running the following.
19+
- Run `termux-setup-storage` to allow storage access, or else code-server won't be able to read from `/sdcard`.\
20+
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.
21+
> The following command was extracted from [Andronix](https://andronix.app/) you can also use [proot-distro](https://github.com/termux/proot-distro).
22+
> After Debian is installed the `~ $` will change to `root@localhost`.
2123
2224
```bash
2325
pkg update -y && pkg install wget curl proot tar -y && wget https://raw.githubusercontent.com/AndronixApp/AndronixOrigin/master/Installer/Debian/debian.sh -O debian.sh && chmod +x debian.sh && bash debian.sh
2426
```
2527

26-
> After Debian is installed the `~ $` will change to `root@localhost`. 3. Run the following commands to setup Debian.
28+
3. Run the following commands to setup Debian.
2729

2830
```bash
2931
apt update
3032
apt upgrade -y
3133
apt-get install nano vim sudo curl wget git -y
3234
```
3335

34-
4. Then create a new user to use later and change its password.
35-
36-
```bash
37-
useradd username -m
38-
passwd username
39-
```
40-
41-
5. Install [NVM](https://github.com/nvm-sh/nvm) by following the install guide in the README, just a curl/wget command.
42-
6. 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; which we do not want (see step 9) so do the following things.
36+
4. Install [NVM](https://github.com/nvm-sh/nvm) by following the install guide in the README, just a curl/wget command.
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; which we do not want (see step 9) so do the following things.
4338

4439
- Copy the lines NVM asks you to run after running the install script.
4540
- Run `nano /root/.bashrc` and comment out those lines by adding a `#` at the start.
4641
- Run `nano /etc/profile` and paste those lines at the end and make sure to replace `$HOME` with `/root`
4742
- Now run `exit` and start Debain again.
4843

49-
7. 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`.
50-
8. You don't need to install yarn.
51-
9. Now you are ready to install code-server, but let's switch users first.
52-
- There are many answers on Stack Exchange for why logging in as root is not recommended,\
53-
but here's a [short article](https://www.howtogeek.com/124950/htg-explains-why-you-shouldnt-log-into-your-linux-system-as-root/) for you.
54-
- Run the following `visudo` to give your user (created in step 4) sudo privileges.
55-
- After executing the command, scroll to `User privilege specification` and add `username ALL=(ALL:ALL) ALL`.
56-
10. To switch users, run `su - username`. **DO NOT forget to add the `-` between `su` and the username or, else the `/etc/profile` file won't be executed,** you may instead follow step 6 but edit the `/etc/bash.bashrc` file instead of `/etc/profile` if you don't want to add a `-` between `su` and username.
57-
58-
11. To install `code-server` run the following.
59-
60-
To check the install process (Will not actually install code-server)
44+
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`.
45+
7. To install `code-server` run the following.
46+
> To check the install process (Will not actually install code-server)
47+
> If it all looks good, you can install code-server by running the second command
6148
6249
```bash
6350
curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run
6451
```
6552

66-
If all looks good, you can run to install code-server.
67-
6853
```bash
6954
curl -fsSL https://code-server.dev/install.sh | sh
7055
```
7156

72-
12. Every time you run `./start-debian.sh` (or `proot-distro login debian` if you used proot-distro), you can switch to your user `su - username` and run code-server.
57+
8. You can now start code server by simply running `code-server`.
58+
59+
> 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.\
60+
> Learn how to add a user [here](https://gist.github.com/arHSM/62242c343efc2827861ddc38e485d7df).
7361
74-
### Upgrade
62+
## Upgrade
7563

7664
1. Remove all previous installs `rm -rf ~/.local/lib/code-server-*`
7765
2. Run the install script again `curl -fsSL https://code-server.dev/install.sh | sh`
7866

79-
### Known Issues
67+
## Known Issues
8068

81-
#### Git won't work in `/sdcard`
69+
### Git won't work in `/sdcard`
8270

8371
Issue : Using git in the `/sdcard` directory will fail during cloning/commit/staging/etc...\
8472
Fix : None\
@@ -87,9 +75,9 @@ Potential Workaround :
8775
1. Create a soft-link from the debian-fs to your folder in `/sdcard`
8876
2. Use git from termux (preferred)
8977

90-
### Extra
78+
## Extra
9179

92-
#### Install GO
80+
### Install Go
9381

9482
> From https://golang.org/doc/install
9583
@@ -109,7 +97,7 @@ rm -rf /usr/local/go && tar -C /usr/local -xzf archive_name
10997
4. Now run `exit` (depending on if you have switched users or not, you may have to run `exit` multiple times to get to normal termux shell) and start Debian again.
11098
5. Check if your install was successful by running `go version`
11199

112-
#### Install Python
100+
### Install Python
113101

114102
> Run these commands as root
115103
@@ -144,4 +132,3 @@ eval "$(pyenv virtualenv-init -)"
144132
7. Run `touch /root/.pyenv/version && echo "your_version_here" > /root/.pyenv/version`
145133
8. (You may have to start Debian again) Run `python3 -V` to verify if PATH works or not.
146134
> 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`.
147-
9. You can now switch users by `su - username` and try running `python3 -V` and `pip -V` to check if it works or not.

0 commit comments

Comments
 (0)