Termux - 图1
© Descargar Termux para PC

由於語法渲染問題而影響閱讀體驗, 請移步博客閱讀~
本文GitPage地址

Version:

Switch to your favorite mirror

  1. termux-change-repo
  1. Select all (or whatever you want)
  2. Select a mirror
    exp: mirror by Tsinghua University

SSH

  1. pkg install openssh # 安装ssh
  2. passwd # 设置登录密码
  3. ifconfig # 获取ip (手机电脑链接同一路由器/局域网)
  4. whoami # 获取用户名
  5. sshd # 开启 ssh 服务

Now, you can login your termux through ssh:

  1. u0_a450@192.168.0.100 -p8022

Cell Phon Storage Access

  1. ##建立storage
  2. termux-setup-storage #(手机需要授予权限)

After executed the code, you can see the directory storage which can connect to your cell phone directories.

Install VNC desktop environment

Document

  1. pkg install x11-repo
  2. pkg install tigervnc
  3. # setup server
  4. vncserver -localhost
  5. # kill desktop
  6. vncserver -kill :1

xfce4 desktop

  1. pkg install xfce4
  2. export DISPLAY=":1"
  3. xfce4-session &
  4. apt install aterm twm

PS:
Though it seems have a ‘perfect’ desktop environment, it can’t show the result of the plot from R and python .

errors

  1. E: Failed to fetch https://10.via0.com/ipns/k51qzi5uqu5dg9vawh923wejqffxiu9bhqlze5f508msk0h7ylpac27fdgaskx/pool/main/libs/libsm/libsm_1.2.3-17_aarch64.deb 521 Origin Down [IP: 172.67.212.200 443]
  2. E: Failed to fetch https://10.via0.com/ipns/k51qzi5uqu5dg9vawh923wejqffxiu9bhqlze5f508msk0h7ylpac27fdgaskx/pool/main/libx/libxext/libxext_1.3.4-11_aarch64.deb 521 Origin Down [IP: 172.67.212.200 443]
  3. E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Connection is unstable, try it few more times.

  1. apt install tigervnc

Some other packages

  1. apt install vim vim-gtk vim-python wget

pythonenv

  1. wget http://python.org/ftp/python/3.7.6/Python-3.7.6.tar.xz
  2. tar xf Python-3.7.6.tar.xz
  3. cd Python-3.7.6
  4. ./configure --enable-optimizations
  5. make altinstall
  6. rm -rf ../Python*xz

kivyenv

  1. pip install -i https://pypi.tuna.tsinghua.edu.cn/simple kivy
  2. pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pillow

hello world example: Kivy hello world

R

Conor I. Anderson

  1. pkg install curl gnupg
  2. mkdir -p "$PREFIX/etc/apt/sources.list.d/"
  3. echo "deb https://its-pointless.github.io/files/24 termux extras" > "$PREFIX/etc/apt/sources.list.d/pointless.list"
  4. curl "https://its-pointless.github.io/pointless.gpg" | apt-key add
  5. pkg install r-base

Install linux

The troditional way (which I faild = =)

想做个好人 2020

  1. apt install openssl
  2. pkg install wget proot
  3. wget https://raw.githubusercontent.com/Neo-Oli/termux-ubuntu/master/ubuntu.sh
  4. bash ubuntu.sh

Tmoe-linux

青菜芋子 2020
Tmoe-repository

You just need run one of them three. I failed for execute the first and succesed on the second.

  1. #bash -c "$(curl -L git.io/linux.sh)"
  2. bash -c "$(curl -L l.tmoe.me)"
  3. #bash -c "$(curl -L https://gitee.com/mo2/linux/raw/2/2)"

Arch in Tmoe

  1. # add a user 'ken'
  2. useradd ken
  3. # add a password for urser 'ken'
  4. passwd ken
  5. # use root acount or run with sudo
  6. vim /etc/sudoers
  7. # siwtch to user ken
  8. su ken

Find the line “root ALL=(ALL) ALL” and add a line:

  1. ken ALL=(ALL) ALL

save and quite

  1. pacman -S r tk
  2. # tk for matplotlib
  3. pip install radian matplotlib docutils pygments pygame

Matplotlib doesn’t show graph

  1. import matplotlib
  2. matplotlib.use('TkAgg')

kivy

Don’t install kivy while pip!!!

  1. pacman -S python sdl2_image sdl2_mixer sdl2_ttf python-setuptools sdl2
  2. pacman -S python-pygame python-kivy

openCV
  1. pip install opencv-python

Some other Softwarw
  1. sudo pacman -Sy yay python-conda
  2. chmod +777 /usr/bin/conda
  3. conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
  4. channel conda config -- remove
  5. conda create --name Bio
  6. source activate
  7. # (base) [user@localhost Desktop]$
  8. conda activate Bio
  9. # (Bio) [user@localhost Desktop]$
  10. sudo pacman -Sy zlib

requests idna chardet urllib3 six

Error

  1. Unable to establish SSL connection.
  1. apt install openssl

Install R in Jupyter Notebook

  1. pip3 install notebook
  1. install.packages("remotes")
  2. remotes::install_github('IRkernel/IRkernel')
  3. # Connect to Jupyter Notebook
  4. IRkernel::installspec()
  5. # 或者是在系统下安装
  6. IRkernel::installspec(user = FALSE)

Enable Jupyter notebook remote (local) computer
Lup Peng 2017

  1. jupyter notebook --generate-config
  2. vim ./.jupyter/jupyter_notebook_config.py
  1. #------------------------------------------------------------------------------
  2. # NotebookApp(JupyterApp) configuration
  3. #------------------------------------------------------------------------------
  4. ...
  5. ## The IP address the notebook server will listen on.
  6. #c.NotebookApp.ip = 'localhost'
  7. + c.NotebookApp.ip = '0.0.0.0'
  1. jupyter notebook password

blast+

  1. apt install blast2

Trinity-try

dependency

  1. apt install cd autoconf
  2. apt install cd automake
  1. # download the trinity. I used the mirror which is more stable in China
  2. wget -c https://github.com.cnpmjs.org/trinityrnaseq/trinityrnaseq/releases/download/v2.12.0/trinityrnaseq-v2.12.0.FULL.tar.gz
  3. tar -zxvf trinityrnaseq-v2.12.0.FULL.tar.gz
  4. cd trinityrnaseq-v2.12.0
  5. make

problem

  1. Err:1 https://termux.org/packages stable/main aarch64 m4 aarch64 1.4.18-3
  2. <span style="color:salmon">OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to termux.org:443</span>
  3. Err:2 https://termux.org/packages stable/main aarch64 autoconf all 2.71
  4. OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to termux.org:443
  5. Unable to correct missing packages.
  6. E: Failed to fetch https://termux.org/packages/pool/main/m/m4/m4_1.4.18-3_aarch64.deb OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to termux.org:443
  7. E: Failed to fetch https://termux.org/packages/pool/main/a/autoconf/autoconf_2.71_all.deb OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to termux.org:443
  8. E: Aborting install.

Reason: failed to connect the github
Set a proxy / VPN

During make

cannot find required auxiliary files: config.guess config.sub
apt install automake
vim /data/data/com.termux/files/home/Biosoft/trinityrnaseq-v2.11.0/trinity-plugins/bamsifter/build_htslib.sh
set -e -v

cd htslib
automake -a
mkdir -p build
autoheader
autoconf
./configure --prefix=`pwd`/build/
make
make install

error: /bin/sh

checking host system type... Invalid configuration `unknown-Linux': machine `unknown' not recognized
configure: error: /bin/sh ./config.sub unknown-Linux failed
sed -i 's=CONFIG_SHELL-/bin/sh=CONFIG_SHELL-/data/data/com.termux/files/usr/bin/sh=' /data/data/com.termux/files/home/Biosoft/trinityrnaseq-v2.11.0/trinity-plugins/bamsifter/htslib/configure | grep "/bin/sh"

Github issue

curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
tar zxvf autoconf-2.70.tar.gz
cd autoconf-2.70
./configure && make

# add to path
source ~/.bashrc

export PATH=$PATH:/data/data/com.termux/files/home/Softwarw/autoconf-2.70/bin
#:wq! exit

source ~/.bashrc

module Autom4te::ChannelDefs

Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module) (@INC contains: /usr/local/share/autoconf /data/data/com.termux/files/usr/lib/perl5/site_perl/5.30.0/aarch64-android /data/data/com.termux/files/usr/lib/perl5/site_perl/5.30.0 /data/data/com.termux/files/usr/lib/perl5/5.30.0/aarch64-android /data/data/com.termux/files/usr/lib/perl5/5.30.0 .) at /data/data/com.termux/files/home/Softwarw/autoconf-2.69/bin/autoheader line 41.

Problem: lack of perl modules

By perldoc perllocal

We can find the module was in /data/data/com.termux/files/usr/lib/perl5/site_perl/5.30.0 directory

Wed May 12 15:19:24 2021: "Module" Test::Warnings
  *   "installed into:
      /data/data/com.termux/files/usr/lib/perl5/site_perl/5.30.0"
  *   "LINKTYPE: dynamic"
  *   "VERSION: 0.030"
  *   "EXE_FILES: "
Wed May 12 15:19:26 2021: "Module" File::Slurper

So, we can make the soft link

ln -s  /data/data/com.termux/files/home/Softwarw/autoconf-2.70/lib/Autom4te /data/data/com.termux/files/usr/lib/perl5/site_perl/5.30.0/Autom4te

/usr/local/bin/

cd bamsifter && make
make[2]: Entering directory '/data/data/com.termux/files/home/Biosoft/trinityrnaseq-v2.12.0/trinity-plugins/bamsifter'
./build_htslib.sh

cd htslib
mkdir -p build
autoheader
sh: 1: /usr/local/bin/autom4te: not found
autoheader: '/usr/local/bin/autom4te' failed with exit status: 127
make[2]: *** [Makefile:10: htslib/version.h] Error 127
/data/data/com.termux/files/home/Biosoft/trinityrnaseq-v2.12.0/trinity-plugins/bamsifter/build_htslib.sh

Problem: in ‘./trinity-plugins/bamsifter/htslib/Makefile’ file, it assigned the prefix = /usr/local

- prefix    = /usr/local
+ prefix    = /data/data/com.termux/files/usr/
exec_prefix = $(prefix)
bindir      = $(exec_prefix)/bin
.
.
.
- $ENV{'SHELL'} = '/bin/sh' if ($^O eq 'dos');
- $ENV{'SHELL'} = '/data/data/com.termux/files/usr/bin/sh' if ($^O eq 'dos');

/data/data/com.termux/files/home/Softwarw/autoconf-2.70/bin/autoheader

This error actually comes form autoheader file:
my $autom4te = $ENV{'AUTOM4TE'} || '/usr/local/bin/autom4te';
We need to change it into:
my $autom4te = $ENV{'AUTOM4TE'} || '/data/data/com.termux/files/home/Softwarw/autoconf-2.70/bin/autom4te'

sed -i 's=/usr/local/bin/autom4te=/data/data/com.termux/files/home/Softwarw/autoconf-2.70/bin/autom4te='  /data/data/com.termux/files/home/Softwarw/autoconf-2.70/bin/autoheader|grep "{'AUTOM4TE'}"

cd htslib
mkdir -p build
autoheader
autom4te: cannot open < /usr/local/share/autoconf/autom4te.cfg: No such file or directory
autoheader: '/data/data/com.termux/files/home/Softwarw/autoconf-2.69/bin/autom4te' failed with e

/data/data/com.termux/files/home/Softwarw/autoconf-2.69/bin/autom4te

- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '/usr/local/share/autoconf';
+ my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '/data/data/com.termux/files/home/Softwarw/autoconf-2.69/lib/';
cd htslib
mkdir -p build
autoheader
autom4te: m4sugar/m4sugar.m4: no such file or directory

/data/data/com.termux/files/home/Softwarw/autoconf-2.69/bin/autom4te

- my $pkgdatadir = $ENV{'AC_MACRODIR'} || '/usr/local/share/autoconf';
+ my $pkgdatadir = $ENV{'AC_MACRODIR'} || '/data/data/com.termux/files/home/Softwarw/autoconf-2.69/bin/';
autoheader
autom4te: cannot open < /data/data/com.termux/files/home/Softwarw/autoconf-2.69/bin/autom4te.cfg: Not a directory
autoheader: '/data/data/com.termux/files/home/Softwarw/autoconf-2.69/bin/autom4te' failed with exit status: 1
mak

/data/data/com.termux/files/home/Softwarw/autoconf-2.69/bin/autom4te

- load_configuration ($ENV{'AUTOM4TE_CFG'} || "$pkgdatadir/autom4te.cfg");
+ load_configuration ($ENV{'AUTOM4TE_CFG'} || "/data/data/com.termux/files/home/Softwarw/autoconf-2.69/lib/autom4te.cfg");

autom4te.cfg

autoheader
autom4te: error: cannot open /usr/local/share/autoconf/autom4te.cfg: No such file or directory
sed  -i 's=/usr/local/share/autoconf=/data/data/com.termux/files/home/Softwarw/autoconf-2.70/lib=' /data/data/com.termux/files/home/Softwarw/autoconf-2.70/bin/autom4te |grep "/data/data/com."

‘s=/usr/local/share/autoconf=/data/data/com.termux/files/home/Softwarw/autoconf-2.69/lib=’

I finally installed 2.71

perl doesn’t support multithreads

./Configure -des -Dprefix=/data/data/com.termux/files/usr/local/perl

-Dusethreads -Uinstalluserbinperl

R

apt install r-base

miniconda

# download miniconda
wget -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py39_4.9.2-Linux-x86_64.sh

# blast+
apt install blast2 bowtie bowtie2

Enjoy~

本文由Python腳本GitHub/語雀自動更新

由於語法渲染問題而影響閱讀體驗, 請移步博客閱讀~
本文GitPage地址

GitHub: Karobben
Blog:Karobben
BiliBili:史上最不正經的生物狗