废旧手机的重复利用之Termux

Termux

Termux 是一款强大的安卓终端模拟 APP,无需 root 直接启动,自动安装最小化 linux 系统,使用 APT 作为包管理工具并提供各种各样的软件包。 高级终端 Termux 组合了强大的终端模拟和拓展 Linux 包收集支持。

官方网站

开始

首先在手机安装上Termux

打开之后直接安装上OpenSSH

apt update
apt install openssh

之后passwd修改密码

在电脑上SSH连接到手机

注:默认端口为8022

优化

修改国内源

镜像仅适用于 Android 7.0 (API 24) 及以上版本,旧版本系统使用本镜像可能导致程序错误。

我最开使被坑了...

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 updatesed -i 's@^\(deb.*stable main\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24 stable main@' $PREFIX/etc/apt/sources.list
pkg update

Ohmyzsh

apt install curl
sh -c "$(curl -fsSL https://github.com/Cabbagec/termux-ohmyzsh/raw/master/install.sh)"  

获取手机数据访问权限

termux-setup-storage

自定义按键

echo "extra-keys = [ \
 ['ESC','|','/','`','UP','QUOTE','APOSTROPHE'], \
 ['TAB','CTRL','~','LEFT','DOWN','RIGHT','ENTER'] \
]" >> ~/.termux/termux.properties

奇奇怪怪的东西

Aria2

pkg install aria2
aria2c --enable-rpc --rpc-listen-all
git clone https://github.com/ziahamza/webui-aria2.git
cd webui-aria2
pkg install nodejs -y
node node-server.js

访问手机IP:8888即可打开

You-get

安装依赖

pkg install python3 ffmpeg -y

安装you-get

pip3 install you-get

升级

pip3 install --upgrade you-get

使用

https://github.com/soimort/you-get/wiki/%E4%B8%AD%E6%96%87%E8%AF%B4%E6%98%8E

AdGuard Home

https://www.moec.top/archives/495

注:版本选择带arm字样的

如果你已经Root,直接使用su
建议使用tsu

pkg install tsu -y
tsu

如果未Root,使用proot达到伪Root的效果,不过我没成功xD

pkg install proot -y
termux-chroot

退出直接 exit

AdGuard Home 安装

#下载
wget https://github.com/AdguardTeam/AdGuardHome/releases/download/v0.102.0/AdGuardHome_linux_arm.tar.gz
#解压
tar -zxvf AdGuardHome*.tar.gz && cd AdGuardHome
#启动AdGuard Home
./AdGuardHome

参考

https://www.sqlsec.com/2018/05/termux.html