之前我发布了一篇arch的配置教程,所以现在想再发布一篇关于debian的配置流程,相对于arch来说debian的配置流程还是更简单快捷的,那么我们直接开始
更换termux的源
termux-change-repo
找到中国的镜像源并选择
开始安装容器前置内容
pkg update -y
pkg install x11-repo -y
pkg install termux-x11-nightly -y
pkg install pulseaudio -y
下载proot容器
pkg install proot-distro -y
下载debian并登录
proot-distro install debian
proot-distro login debian
配置debian
apt update
apt install nano adduser -y
apt install sudo
添加普通用户(此处的用户名是以我自己的习惯配置,可根据你自己的喜好更改用户名,但是要保证后面的流程中用户名的一致)
adduser moze
创建密码,输入两次确认,接着创建用户名,我会只创建用户名纆泽,然后一直回车,其他的信息可留空,如果有提升字符问题,不必理会,输入y确认
nano /etc/sudoers
moze ALL=(ALL:ALL) ALL
Ctrl+o Ctrl+x
切换用户检查权限是否配置正确
su - moze
sudo whoami
安装桌面环境(此处依旧选择xfce4)
sudo apt install xfce4
——————————中文环境配置—————————
sudo apt install locales
sudo dpkg-reconfigure locales
选择314,再选择3
sudo apt install fonts-wqy-microhei fonts-wqy-zenhei xfonts-wqy
———————配置启动桌面环境命令————————
在termux中输入以下命令添加软连接方便访问usr
ln -s /data/user/0/com.termux/files/usr/ /data/user/0/com.termux/files/home/usr
cd usr/bin
创建启动脚本
nano startx11
把这段脚本粘贴进去(脚本中也有对应用户名,请注意更改)
#!/data/data/com.termux/files/usr/bin/bash
rm -rf /data/data/com.termux/files/usr/tmp/*pulse*
pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1
export XDG_RUNTIME_DIR=${TMPDIR}
termux-x11 :0 >/dev/null &
sleep 1
am start --user 0 -n com.termux.x11/com.termux.x11.MainActivity > /dev/null 2>&1
proot-distro login debian --shared-tmp -- /bin/bash -c 'export PULSE_SERVER=127.0.0.1 && export XDG_RUNTIME_DIR=${TMPDIR} && su - moze -c "env DISPLAY=:0 startxfce4"' &>/dev/null &
sleep 1
rm -rf $TMPDIR/pulse-* && exit &>/dev/null &
exit 0
—————————————————————————
Ctrl+o Ctrl+x
给予权限
chmod +x startx11
然后输入startx11即可进入桌面
—————————升级kali————————————
kali linux是基于debian的发行版,所以在termux的proot容器中,我们可以直接让debian升级到kali
先添加kali的中国镜像源
nano /etc/apt/sources.list
在底下添加
deb http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
deb-src http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
Ctrl+o Ctrl+x
添加密钥
sudo apt install gnupg
sudo gpg --keyserver keyserver.ubuntu.com --recv-keys ED444FF07D8D0BF6
sudo gpg --export --armor ED444FF07D8D0BF6 | sudo tee /etc/apt/trusted.gpg.d/kali-archive-keyring.asc
更新包源并升级
sudo apt update
sudo apt full-upgrade
等待下载解压完毕即可升级完成
查看系统的发行版
lsb_release -a
—————————注意事项————————————
如果说在刚开始配置容器更新包源的时候连接官方源更新速度比较慢,实在受不了的建议更换debian的国内镜像源
apt update
apt install nano
nano /etc/apt/sources.list
把原来的官方源全部#掉,添加以下源
deb https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
Ctrl+o Ctrl+x
更新包源检查可用性
apt update
如遇到黑屏问题请按照以下方法修复
proot-distro login debian
apt install dbus-x11
教程到此结束,此教程是我学习其他大佬的教程然后自己琢磨整合出来的,如有不对希望可以帮我指出错误,有问题可以在评论区一起交流讨论,谢谢。