termux 安装 rockylinux

centos已经被“招安”了,取而代之的是rockylinux,本文记录我自己的配置,主要需求是使用termux安装rockylinux文件系统,并使用supervisor自启动code-server

安装termux

https://github.com/termux/termux-app/releases/获取最新的安装包
目前最新的是v0.118.1,安卓机一般是选arm64-v8的版本

配置ssh

手机输入命令总归有点不习惯,还是用电脑ssh登陆比较好

# 更新当前包版本,以防有不兼容
pkg update
# 安装openssh
pkg install openssh
# 启动ssh服务 
sshd
# 配置termux密码
passwd
# 通过本机wifi获取手机ip,电脑在同一局域网下进行 `ssh root@手机ip -p 8022` 连接

安装proot-distro

pkg install proot-distro

配置proot-distro支持自定义镜像

(可选)获取最新rocky linux rootfs

https://rockylinux.org/download找最新的文件目录,选择ARM版本的image
或者直接查看目录https://download.rockylinux.org/pub/rocky/9/images/或者国内阿里云镜像https://mirrors.aliyun.com/rockylinux/9/images,按照cpu架构(安卓9手机一般是aarch64arm最新架构),获取镜像地址https://mirrors.aliyun.com/rockylinux/9/images/aarch64/Rocky-9-Container-Base.latest.aarch64.tar.xz,以及checksumhttps://mirrors.aliyun.com/rockylinux/9/images/aarch64/Rocky-9-Container-Base-9.4-20240523.0.aarch64.tar.xz.CHECKSUM里的SHA256信息更新到以下rocky9.sh脚本,如果不需要直接使用即可

配置proot-distro rocky9镜像

cat << EOF >  $HOME/../../files/usr/etc/proot-distro/rocky9.sh
# This is a default distribution plug-in.
# Do not modify this file as your changes will be overwritten on next update.
# If you want customize installation, please make a copy.
DISTRO_NAME="Rocky Linux"
DISTRO_COMMENT="Latest Release."

TARBALL_MIRROR_URL="https://mirrors.aliyun.com/rockylinux"

TARBALL_URL['aarch64']="\${TARBALL_MIRROR_URL}/9/images/aarch64/Rocky-9-Container-Base-9.4-20240523.0.aarch64.tar.xz"
TARBALL_SHA256['aarch64']="ccc9fbef24be4d64e6430f4f5738a4c9f3ca6994ba174647fddec1f3e2714b54"
TARBALL_URL['x86_64']="\${TARBALL_MIRROR_URL}/9/images/x86_64/Rocky-9-Container-Base-9.4-20240523.0.x86_64.tar.xz"
TARBALL_SHA256['x86_64']="c629dd41510cbe273a73b76c7d4e4a549d2c2192fce59dc89d5549b95edfd6ca"
EOF

安装&配置 rocky9 linux 文件系统

proot-distro install rocky9
# 登陆子系统
proot-distro login rocky9

安装&配置code-server

[root@localhost ~]curl -fsSL https://code-server.dev/install.sh | sh
# (可选)如果太慢可以选择使用github镜像加速hub.gitmirror.com等
# curl -fsSL https://code-server.dev/install.sh |sed 's#https://github.com#https://hub.gitmirror.com/https://github.com#g' | sh
[root@localhost ~]code-server
[root@localhost ~]vi .config/code-server/config.yaml

修改文件中的bind-addr和password
bind-addr: 0.0.0.0:8080
auth: password
password: 你的密码
cert: false

安装 supervisor 管理code-server

[root@localhost ~] dnf install epel-release
[root@localhost ~] dnf install supervisor
[root@localhost ~] mkdir .log
[root@localhost ~] cat << EOF > /etc/supervisord.d/vscode.ini
[program:vscode] 
command=code-server
autorestart=true            
redirect_stderr=true
stdout_logfile = ~/.log/vscodeserver.log
loglevel=info
autostart=true
EOF
[root@localhost ~] supervisord -c /etc/supervisor/supervisord.conf 

相关推荐

  1. termux 安装 rockylinux

    2024-07-13 16:02:05       22 阅读
  2. termux安装openssh+nginx

    2024-07-13 16:02:05       51 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-13 16:02:05       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-13 16:02:05       72 阅读
  3. 在Django里面运行非项目文件

    2024-07-13 16:02:05       58 阅读
  4. Python语言-面向对象

    2024-07-13 16:02:05       69 阅读

热门阅读

  1. 阿里云通义千

    2024-07-13 16:02:05       21 阅读
  2. 前端实现PDF文件打印和下载

    2024-07-13 16:02:05       19 阅读
  3. docker 安装orcale11数据库

    2024-07-13 16:02:05       21 阅读
  4. 缓冲区共享和同步dma_buf 之二

    2024-07-13 16:02:05       19 阅读
  5. Kylin的优缺点

    2024-07-13 16:02:05       19 阅读
  6. 【C语言】头文件命名详解 - 《铁头无敌 ! 》

    2024-07-13 16:02:05       21 阅读
  7. express

    express

    2024-07-13 16:02:05      20 阅读
  8. 【笔记】修改centos7过期的官方镜像资源

    2024-07-13 16:02:05       22 阅读
  9. Python:正则表达式相关整理

    2024-07-13 16:02:05       20 阅读