* Fix : recreate the termux guide to adapt the recent changes Termux nodejs-lts changed from v14 to v16 and there are many issues people are facing such as with argon2. Hence I recommend changing it to this install process which is comparably better and has one less issue :^) I've also added some extra things such as installing GO and Python, idk about the TOC tree but this is pretty much it. * yarn-fmt and minor typos https://github.com/cdr/code-server/pull/4472#issuecomment-964752180 * Fix : replace unnecessary steps to be linked to a guide * Change from private gist to a section in Extra * Remove reference to non-existent step * ready to merge! Co-authored-by: Joe Previte <jjprevite@gmail.com>
6.1 KiB
Termux
Install
- Get Termux from F-Droid.
- Install Debian by running the following.
- Run
termux-setup-storageto allow storage access, or else code-server won't be able to read from/sdcard.
If you used the Andronix command then you may have to edit thestart-debian.shscript to mount/sdcardjust as simple as uncommenting thecommand+=" -b /sdcard"line.The following command was extracted from Andronix you can also use proot-distro. After Debian is installed the
~ $will change toroot@localhost.
- Run
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
- Run the following commands to setup Debian.
apt update
apt upgrade -y
apt-get install nano vim sudo curl wget git -y
-
Install NVM by following the install guide in the README, just a curl/wget command.
-
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;
- Copy the lines NVM asks you to run after running the install script.
- Run
nano /root/.bashrcand comment out those lines by adding a#at the start. - Run
nano /etc/profileand paste those lines at the end and make sure to replace$HOMEwith/root - Now run
exitand start Debain again.
-
After following the instructions and setting up NVM you can now install the required node version using
nvm install version_here. -
To install
code-serverrun the following.To check the install process (Will not actually install code-server) If it all looks good, you can install code-server by running the second command
curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run
curl -fsSL https://code-server.dev/install.sh | sh
- You can now start code server by simply running
code-server.
Consider using a new user instead of root, read here why using root is not recommended.
Learn how to add a user here.
Upgrade
- Remove all previous installs
rm -rf ~/.local/lib/code-server-* - Run the install script again
curl -fsSL https://code-server.dev/install.sh | sh
Known Issues
Git won't work in /sdcard
Issue : Using git in the /sdcard directory will fail during cloning/commit/staging/etc...
Fix : None
Potential Workaround :
- Create a soft-link from the debian-fs to your folder in
/sdcard - Use git from termux (preferred)
Extra
Create a new user
To create a new user follow these simple steps -
- Create a new user by running
useradd username -m. - Change the password by running
passwd username. - Give your new user sudo access by runnning
visudo, scroll down toUser privilege specificationand add the following line after rootusername ALL=(ALL:ALL) ALL. - Now edit the
/etc/passwdfile with your commadline editor of choice and at the end of the line that specifies your user change/bin/shto/bin/bash. - Now switch users, by running
su - username
- Remember the
-betweeensuand username is required to execute/etc/profile,
since/etc/profilemay have some necessary things to be executed you should always add a-.
Install Go
- Go to https://golang.org/dl/ and copy the download link for
linux armand run the following.
wget download_link
- Extract the downloaded archive. (This step will erase all previous GO installs, make sure to create a backup if you have previously installed GO)
rm -rf /usr/local/go && tar -C /usr/local -xzf archive_name
- Run
nano /etc/profileand add the following lineexport PATH=$PATH:/usr/local/go/bin. - Now run
exit(depending on if you have switched users or not, you may have to runexitmultiple times to get to normal termux shell) and start Debian again. - Check if your install was successful by running
go version
Install Python
Run these commands as root
- Run the following command to install required packages to build python.
sudo apt-get update
sudo apt-get install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
- Install pyenv from pyenv-installer by running.
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
- Run
nano /etc/profileand add the following
export PYENV_ROOT="/root/.pyenv"
export PATH="/root/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
- Exit start Debian again.
- Run
pyenv versionsto list all installable versions. - Run
pyenv install versionto install the desired python version.The build process may take some time (an hour or 2 depending on your device).
- Run
touch /root/.pyenv/version && echo "your_version_here" > /root/.pyenv/version - (You may have to start Debian again) Run
python3 -Vto verify if PATH works or not.If
python3doesn't work but pyenv says that the install was successful in step 6 then try running$PYENV_ROOT/versions/your_version/bin/python3.