手机termux安装Linux发行版实现无root安装青龙面板

1、termux安装

【termux官网】

2、termux安装Linux发行版Alpine

  • 安装

    curl -LO https://gh.erma0.cn/https://github.com/Hax4us/TermuxAlpine/blob/master/TermuxAlpine.sh
    bash TermuxAlpine.sh
    
    
  • 启动alpine

    startalpine
    

3、Alpine安装青龙

set -x \
&& mkdir -p /ql \
&& cd /ql \
&& echo -e "\n\
export QL_DIR=/ql\n\
export QL_BRANCH=master\n\
export LANG=zh_CN.UTF-8\n\
export TERMUX_APK_RELEASE=F-DROID\n\
export SHELL=/bin/bash\n\
export PATH=~/.local/share/pnpm/global/5/node_modules:$PATH\n\
export CHARSET=UTF-8\n" \
>> ~/.bashrc \
&& source ~/.bashrc \
&& echo -e "nameserver 119.29.29.29\n\
nameserver 8.8.8.8" > /etc/resolv.conf \
&& sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \
&& apk update -f \
&& apk upgrade \
&& apk --no-cache add -f bash make nodejs npm \
coreutils moreutils git curl wget tzdata perl \
openssl nginx jq openssh python3 py3-pip \
&& rm -rf /var/cache/apk/* \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& npm install -g pnpm \
&& pnpm setup \
&& source ~/.bashrc \
&& pnpm add -g pm2 ts-node typescript tslib \
&& git clone -b $QL_BRANCH https://gh.erma0.cn/https://github.com/whyour/qinglong.git $QL_DIR \
&& cd $QL_DIR \
&& cp -f .env.example .env \
&& chmod 777 $QL_DIR/shell/*.sh \
&& chmod 777 $QL_DIR/docker/*.sh \
&& pnpm install --prod \
&& rm -rf /root/.pnpm-store \
&& rm -rf /root/.local/share/pnpm/store \
&& rm -rf /root/.cache \
&& rm -rf /root/.npm \
&& git clone -b $QL_BRANCH https://gh.erma0.cn/https://github.com/whyour/qinglong-static.git /static \
&& mkdir -p $QL_DIR/static \
&& cp -rf /static/* $QL_DIR/static \
&& rm -rf /static \
&& ln -s /ql/docker/docker-entrypoint.sh /usr/bin/qinglong \
&& qinglong

报错

  • alpine安装失败
    清除termux数据(再重启手机更好),重新重新执行安装alpine命令
  • sqlite3安装失败
    原因不清楚,之前查半天解决的,又忘记了,不过不是所有设备都会报错,一般重新安装就可以解决
    重新执行安装命令,即pnpm install --prod,然后再执行之后的所有命令,也可以直接复制下面这段

    pnpm install --prod \
    && rm -rf /root/.pnpm-store \
    && rm -rf /root/.local/share/pnpm/store \
    && rm -rf /root/.cache \
    && rm -rf /root/.npm \
    && git clone -b $QL_BRANCH https://gh.erma0.cn/https://github.com/whyour/qinglong-static.git /static \
    && mkdir -p $QL_DIR/static \
    && cp -rf /static/* $QL_DIR/static \
    && rm -rf /static \
    && ln -s /ql/docker/docker-entrypoint.sh /usr/bin/qinglong \
    && qinglong
    

你可能感兴趣的:(shell)