Termux简单入门
Termux 是一款Android 终端模拟器和 Linux 环境应用程序,无需 root 或设置即可直接运行。自动安装最小的基本系统 - 使用 APT 包管理器可以使用其他包。
下载
play商店的版本是老版本,建议安装最新版本。如果是Play版本,大概率会碰到403的问题(需要执行apt upgrade -y
)。
从 F-Droid 下载
开光
1 | apt update -y |
远程连接
安装过openssh后,在电脑上操作就更简单了
1 | # 安装ssh服务 |
通过密码方式
1 | # 设置密码 |
通过公钥方式
1 | # 在Android上执行 |
通过服务方式启动
Package | Daemon | Port | Description |
---|---|---|---|
apache2 | httpd | 8080 | Apache Web Server HTTP Web Server |
at | atd | AT and batch delayed command scheduling utility and daemon at | |
bitcoin | bitcoind | Bitcoin Core | |
busybox | telnetd | 8023 | Remote terminal service Telnet |
busybox | ftpd | 8021 | FTP (File Transfer Protocol) FTP |
cronie | crond | Daemon that runs specified programs at scheduled times cron | |
emacs | emacsd | Extensible, customizable text editor-and more EMACS | |
ipfs | ipfs | A peer-to-peer hypermedia distribution protocol IPFS | |
libmosquitto | mosquitto | 1883 | MQTT is a lightweight, publish-subscribe network protocol MQTT |
lighttpd | lighttpd | 8080 | Lighttpd Small webserver HTTP Web Server |
lnd | lnd | Lightning Network Daemon | |
mariadb | mysqld | 3306 | MariaDB Community-developed fork of the MySQL from its original authors |
mpd | mpd | Music Player Daemon (MPD) | |
mpdscribble | mpdscribble | MPD client which submits tracks being played | |
nginx | nginx | 8080 | NGINX Web server HTTP Web Server |
openssh | sshd | 8022 | OpenSSH SSH |
postgresql | postgres | 5432 | PostgreSQL database PostgreSQL |
privoxy | privoxy | Privoxy is non-caching web proxy with advanced filtering capabilities HTTP Proxy | |
tor | tor | The Onion Router anonymizing overlay network Tor | |
transmission | transmission | BitTorrent client BitTorrent |
1 | 在安装 termux-services 完成后,需要重启app(杀进程) |
开机启动
需安装APP:Termux:Boot
运行一次,并添加到电池优化白名单
添加配置
1 | mkdir ~/.termux/boot/ |
1 | #!/data/data/com.termux/files/usr/bin/sh |
赋予执行权限
1 | chmod +x ~/.termux/boot/startup.sh |
Docker
目前的方案是,模拟x86,然后运行Docker。效率感人
原作者的后续步骤看不懂了,暂时不折腾
另外一个方案,需要编译Android内核。但是不需要虚拟机了
1 | # 安装必要的包 |
wget https://golang.org/dl/go1.17.2.linux-arm64.tar.gz
pkg install mariadb
刷Linux原生系统(类似LineageOS)
https://postmarketos.org/
弱弱的问一下,android手机为什么不能刷linux?
https://www.zhihu.com/question/277198849