如何在手机和平板上使用Linux系统命令

162 阅读1分钟

目录

1. 前言

2. 效果图展示

3. 安装termux

4. 安装Centos系统

4.1 更换源

4.2 拉取镜像

4.3 启动centos

5.结尾


1. 前言

大家好,我是jiaoxingk

今天这篇文章让你能够在手机或者平板上使用Linux-Centos系统

让你随时随地都能操作命令行进行装13

2. 效果图展示

bdc8cd0b47d01a97d102c6bb31e163ec.jpg

3. 安装termux

废话不多说,咋们直接开干!

首先下载termux,并且安装到手机或者平板上面:

链接:pan.baidu.com/s/1LUhUqHye… 
提取码:yrcf 

4. 安装Centos系统

安装完之后,应该是这样的:

54cae1802482b3e28cdfb8c3e9aae282.jpg

4.1 更换源

我们先更换源,加速下载


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 update

4.2 拉取镜像

先安装依赖:

pkg install proot git python -y

接着执行:

git clone https://github.com/sqlsec/termux-install-linux
cd termux-install-linux
python termux-linux-install.py

此时会出现这种:

164a3a1e652af8183fedfd1b820b0c4e.jpg

我们选择7就好了,然后等待安装完成

4.3 启动centos

等待安装完成后,我们ctrl + c退出

依次执行:

cd ..
cd Termux-Linux/
cd CentOS
最后执行
./start-centos.sh

 ok,当显示出[root@localhost]就算成功啦

5.结尾

通过本篇文章,你就可以愉快地操作Centos系统了。