Termux的安装及配置

Termux 简介

转载地址

国光-基本配置:https://www.sqlsec.com/2018/05/termux.html
国光-安装Linux:https://www.sqlsec.com/2020/04/termuxlinux.html

文档相关

下载地址

更换国内源

方法一:自动替换

sed -i 's@^\(deb.*stable main\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24 stable main@' $PREFIX/etc/apt/sources.list

sed -i 's@^\(deb.*games stable\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/game-packages-24 games stable@' $PREFIX/etc/apt/sources.list.d/game.list

sed -i 's@^\(deb.*science stable\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/science-packages-24 science stable@' $PREFIX/etc/apt/sources.list.d/science.list

pkg update

方法二:手动修改

编辑 $PREFIX/etc/apt/sources.list 修改为如下内容

# The termux repository mirror from TUNA:
deb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24 stable main

编辑 $PREFIX/etc/apt/sources.list.d/science.list 修改为如下内容

# The termux repository mirror from TUNA:
deb https://mirrors.tuna.tsinghua.edu.cn/termux/science-packages-24 science stable

编辑 $PREFIX/etc/apt/sources.list.d/game.list 修改为如下内容

# The termux repository mirror from TUNA:
deb https://mirrors.tuna.tsinghua.edu.cn/termux/game-packages-24 games stable

安装基础工具

pkg update
pkg install vim curl wget git tree -y

Termux安装SSH Server

#安装OpenSSH
$ pkg install openssh

#运行SSH Server
$ sshd

#设置密码
$ passwd 

#获得Android IP
$ ifconfig

#客户端运行
$ ssh android_ip -p 8022

Termux安装完整Linux

Termux一键安装Linux脚本Github地址:https://github.com/sqlsec/termux-install-linux

依赖安装

pkg install proot git python -y

基本使用

git clone https://github.com/sqlsec/termux-install-linux
cd termux-install-linux
python termux-linux-install.py

Ubuntu

cd ~/Termux-Linux/Ubuntu
./start-ubuntu.sh

Debian

cd ~/Termux-Linux/Debian
./start-debian.sh

Centos

cd ~/Termux-Linux/Centos
./start-centos.sh

留下评论