Termux配置

1. 设置源

termux-change-repo  #图形界面替换
vim  /etc/apt/sources.list  #手动替换
apt update  #更新源

2. 基本软件

pkg的底层就是apt,只是运行前会执行一次apt update,保证安装的是最新版本。所以,apt install sl基本等同于pkg install sl。

pkg upgrade #更新软件
pkg install vim curl wget git rxfetch   #安装常用软件包
pkg install openssh    #安装ssh服务
pkg install proot      #安装proot模拟root用户

3. 开启权限

termux-chroot  #开启管理员身份避免不必要的bug
termux-setup-storage  #访问手机存储,默认在storage子目录
ln -s /data/data/com.termux/files/home/storage/shared/tencent/QQfile_recv QQ #创建qq目录软链接
vim $PREFIX/etc/motd  #修改默认问候语
echo $PREFIX  #安装程序环境变量

4. 使用容器

bash -c "$(curl -L l.tmoe.me)"    #tmoe图形容器
startvnc    #linux使用vnc远程
## 安装docker容器
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update && sudo apt-get install docker-ce docker-ce-cli containerd.io

5. 扫描端口

Andorid 10 以下的版本是可以正常使用 netstat 命令

netstat -ano | grep 8022  #查看8022端口是否开放

Andorid 10 及以上版本的 Termux 下无法正常使用 netstat -an 命令

pkg install nmap
nmap 127.0.0.1 | grep 8022  #查看8022端口是否开放

6. 开发环境

termux的包安装命令是pkg或者apt
apt install python-pip
(在termux下安装python包,一般直接pip)
  • 安装hzt
git clone https://github.com/WindowHZT/hzt && cd hzt && bash ./Install.sh
  • 安装ipython
pip install ipython
  • 自动化Vim配置
git clone https://github.com/GavinSun0921/Auto-configuration-vim.git && cd Auto-configuration-vim && sh init.sh  
  • 安装Vercel部署
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash # 安装nvm管理nodejs版本
nvm install 22.8. ##通常nodejs自带npm
apt install npm
npm cache clean --force  # 先清除缓存
npm config set registry https://registry.npm.taobao.org/npm  # 设置淘宝源
npm config set strict-ssl false # 暂时关闭SSL证书验证
npm install -g npm@latest # 更新至最新npm
npm i -g vercle
posted @ 2024-11-10 21:19  NAGISB  阅读(277)  评论(0编辑  收藏  举报