-
Notifications
You must be signed in to change notification settings - Fork 0
/
ubuntu-24_04-instalation.sh
67 lines (49 loc) · 2.45 KB
/
ubuntu-24_04-instalation.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/data/data/com.termux/files/usr/bin/bash
# Define rootfs link and distro name
ROOTFS_LINK="https://cloud-images.ubuntu.com/releases/24.04/release-20240911/ubuntu-24.04-server-cloudimg-arm64-root.tar.xz"
DISTRO_NAME="ubuntu"
# Change Termux repo
termux-change-repo
# Updating Termux repo
pkg update
# Install nano
pkg install nano
# Installing updates
pkg upgrade
# Setting up Termux access to Android storage (downloads, photos, etc.)
termux-setup-storage
# Download and prepare the wget-proot.sh script
curl -O https://raw.githubusercontent.com/23xvx/Termux-Proot-Custom-Installer/main/wget-proot.sh
chmod +x wget-proot.sh
# Copy the script and apply the necessary modifications using sed
cp wget-proot.sh wget-proot-modified.sh
sed -i "s|read URL|URL=${ROOTFS_LINK}|" wget-proot-modified.sh
sed -i "s|read ds_name|ds_name=${DISTRO_NAME}|" wget-proot-modified.sh
# Run the modified script with no user interaction
bash wget-proot-modified.sh
###################################################################
# Execute commands inside the Ubuntu environment
bash ubuntu.sh "apt update -y && apt upgrade -y && apt install xfce4 xfce4-session xfce4-goodies mesa-utils tigervnc-standalone-server neofetch dbus-x11 -y"
# Set up the VNC password automatically (set to "linux")
bash ubuntu.sh "mkdir -p ~/.vnc && echo -e 'linux\nlinux' | vncpasswd -f > ~/.vnc/passwd && chmod 600 ~/.vnc/passwd"
# Edit the VNC startup configuration file inside the Ubuntu environment
bash ubuntu.sh "cat << 'EOF' > ~/.vnc/xstartup
#!/bin/sh
xrdb \$HOME/.Xresources
dbus-launch --exit-with-session &
startxfce4
EOF
chmod +x ~/.vnc/xstartup"
# Export environment variables and configure VNC inside Ubuntu
bash ubuntu.sh "export USER=root && echo 'export USER=root' >> ~/.bashrc && export DISPLAY=:1 && export XDG_RUNTIME_DIR=/tmp/runtime-root && touch ~/.Xauthority"
# Install Xserver as a precaution
bash ubuntu.sh "apt install x11-xserver-utils -y"
# Restart the VNC server to apply changes and start it for the first time
bash ubuntu.sh "vncserver -kill :1 && vncserver"
# Download and install Firefox-ESR directly from the Debian FTP
bash ubuntu.sh "
DOWNLOAD_URL='http://ftp.us.debian.org/debian/pool/main/f/firefox-esr/firefox-esr_115.15.0esr-1_arm64.deb'
wget -P ~/Downloads \"\$DOWNLOAD_URL\"
dpkg -i ~/Downloads/\$(basename \"\$DOWNLOAD_URL\") || apt-get install -f -y"
# Add Firefox configuration to .bashrc
bash ubuntu.sh "echo 'export MOZ_DISABLE_CONTENT_SANDBOX=1' >> ~/.bashrc && source ~/.bashrc"