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
Copy file name to clipboardExpand all lines: docs/termux.md
+24-37Lines changed: 24 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -7,78 +7,66 @@
7
7
-[Known Issues](#known-issues)
8
8
-[Git won't work in `/sdcard`](#git-wont-work-in-sdcard)
9
9
-[Extra](#extra)
10
-
-[Install GO](#install-go)
10
+
-[Install Go](#install-go)
11
11
-[Install Python](#install-python)
12
12
13
13
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
14
14
15
-
###Install
15
+
## Install
16
16
17
17
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`.
> 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.
27
29
28
30
```bash
29
31
apt update
30
32
apt upgrade -y
31
33
apt-get install nano vim sudo curl wget git -y
32
34
```
33
35
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.
43
38
44
39
- Copy the lines NVM asks you to run after running the install script.
45
40
- Run `nano /root/.bashrc` and comment out those lines by adding a `#` at the start.
46
41
- Run `nano /etc/profile` and paste those lines at the end and make sure to replace `$HOME` with `/root`
47
42
- Now run `exit` and start Debain again.
48
43
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
61
48
62
49
```bash
63
50
curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run
64
51
```
65
52
66
-
If all looks good, you can run to install code-server.
67
-
68
53
```bash
69
54
curl -fsSL https://code-server.dev/install.sh | sh
70
55
```
71
56
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).
73
61
74
-
###Upgrade
62
+
## Upgrade
75
63
76
64
1. Remove all previous installs `rm -rf ~/.local/lib/code-server-*`
77
65
2. Run the install script again `curl -fsSL https://code-server.dev/install.sh | sh`
78
66
79
-
###Known Issues
67
+
## Known Issues
80
68
81
-
####Git won't work in `/sdcard`
69
+
### Git won't work in `/sdcard`
82
70
83
71
Issue : Using git in the `/sdcard` directory will fail during cloning/commit/staging/etc...\
84
72
Fix : None\
@@ -87,9 +75,9 @@ Potential Workaround :
87
75
1. Create a soft-link from the debian-fs to your folder in `/sdcard`
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.
110
98
5. Check if your install was successful by running `go version`
0 commit comments