Introduction#
Installing Ubuntu on an idle old Android phone (no root required)
Preparation#
Download the Termux app, corresponding link: https://github.com/termux/termux-app/releases
Switch to a domestic mirror source
termux-change-repo
Download software
pkg install vim
Create a directory and set storage permissions
Create a directory a
in the root directory of the phone, then enter the a
directory to create a file
directory
termux-setup-storage
# Set up a soft link
ln -s storage/shared/a/file file
Installing Ubuntu#
Download proot-distro#
pkg install proot-distro
Download Ubuntu#
There are two ways to download Ubuntu
Method 1: Direct download
# Check the system to be installed
proot-distro list
# Download and install Ubuntu
proot-distro install ubuntu
Method 2: Install from a compressed package
If direct download is too slow, you can first download the image compressed package from GitHub, specific link: https://github.com/termux/proot-distro/releases/download/v4.18.0/ubuntu-noble-aarch64-pd-v4.18.0.tar.xz
Place the downloaded compressed package file into the phone's a/file
directory, then move it to the $PREFIX/var/lib/proot-distro/dlcache
directory, and then execute proot-distro install ubuntu
. Specific commands:
# Move the compressed package
mv ~/file/ubuntu-noble-aarch64-pd-v4.18.0.tar.xz $PREFIX/var/lib/proot-distro/dlcache
# Execute the download command
proot-distro install ubuntu
After installation is complete, log in to Ubuntu
proot-distro login ubuntu
Switch to a domestic mirror source#
Update existing sources
apt update -y
Download ca-certificates
apt install ca-certificates -y
Starting from Ubuntu 24.04, the configuration file for Ubuntu's software sources has changed to DEB822 format
# Comment out the One-Line-Style configuration file
mv /etc/apt/sources.list /etc/apt/sources.list.bak
# Create a configuration file using DEB822 format
vim /etc/apt/sources.list.d/ubuntu.sources
Types: deb
URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# The source mirror for source code is commented out by default to speed up apt update; you can uncomment it if needed
# Types: deb-src
# URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports
# Suites: noble noble-updates noble-backports
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# The following security update software sources include official sources and mirror site configurations; you can modify comments to switch if needed
Types: deb
URIs: http://ports.ubuntu.com/ubuntu-ports/
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# Types: deb-src
# URIs: http://ports.ubuntu.com/ubuntu-ports/
# Suites: noble-security
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# Pre-release software sources are not recommended to be enabled
# Types: deb
# URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports
# Suites: noble-proposed
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# # Types: deb-src
# # URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports
# # Suites: noble-proposed
# # Components: main restricted universe multiverse
# # Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# Update
apt update -y && apt upgrade -y
Remote Connection#
apt install openssh-server -y
# Modify /etc/ssh/sshd_config, uncomment the following content and modify
Port 8253 # Using a smaller numerical port will not take effect
PermitRootLogin yes
PasswordAuthentication yes
service ssh start
service ssh status
# Set to start on boot
update-rc.d ssh enable
If ssh does not start on boot, append service ssh start
in the ~/.bashrc
file.
echo "service ssh start" >> ~/.bashrc