Recovery Procedures
Things break. A bad package upgrade, a corrupted filesystem, or a misconfigured desktop can leave your ADL setup in an unusable state. This guide covers how to recover --- from targeted component resets to a full clean start.
Most recovery procedures described here are destructive. Always back up your data before proceeding. See the Backup and Restore section first.
Reset Ubuntu Without Losing Termuxโ
If your Ubuntu proot environment is broken but Termux itself still works, you can remove and reinstall just the distro. This preserves your Termux packages, configuration, and storage.
Remove the Existing Ubuntu Installationโ
proot-distro remove ubuntuThis deletes the entire Ubuntu filesystem under $PREFIX/var/lib/proot-distro/installed-rootfs/ubuntu. Your Termux home directory, packages, and shell configuration are untouched.
Reinstall Ubuntuโ
proot-distro install ubuntuAfter reinstalling, log in and re-run your desktop setup. See the Install Ubuntu and Install Desktop guides for the full steps.
If you only need to fix a specific issue inside Ubuntu, try logging in with proot-distro login ubuntu first. A targeted fix is almost always faster than a full reinstall.
Preserve Your Ubuntu Home Directoryโ
If you want to keep your personal files while resetting the system, back up your Ubuntu home directory before removing the distro:
proot-distro login ubuntu -- tar czf /sdcard/ubuntu-home-backup.tar.gz -C /home .After reinstalling Ubuntu, restore it:
proot-distro login ubuntu -- tar xzf /sdcard/ubuntu-home-backup.tar.gz -C /homeReinstall Specific Componentsโ
You do not always need to reset the entire distro. Individual components can be removed and reinstalled inside your Ubuntu proot session.
XFCE Desktopโ
Remove and reinstall the XFCE desktop environment:
sudo apt purge xfce4 xfce4-goodies -y && sudo apt autoremove -ysudo apt install xfce4 xfce4-goodies -yPulseAudioโ
If audio is broken, reset PulseAudio:
sudo apt purge pulseaudio -y && rm -rf ~/.config/pulsesudo apt install pulseaudio -yRemoving the ~/.config/pulse directory clears user-level PulseAudio configuration. This fixes most audio issues caused by stale or corrupt config files.
VNC Serverโ
If your VNC server refuses to start or displays a blank screen, clear its state and reconfigure:
vncserver -kill :1rm -rf ~/.vncThen re-run your VNC setup as described in the Install Desktop guide.
Reset XFCE Panel and Settingsโ
A misconfigured panel or broken theme can make the desktop unusable without requiring a full XFCE reinstall:
rm -rf ~/.config/xfce4/panel ~/.config/xfce4/xfconfThe next time you start XFCE, it will regenerate default panel and session configuration.
Backup and Restoreโ
Make backups a habit. Run a backup before any major upgrade, configuration change, or recovery procedure. Storage on /sdcard survives both Termux and Ubuntu resets.
What to Back Upโ
Not everything in the Ubuntu filesystem is worth saving. Focus on these locations:
| Path | Contents |
|---|---|
/home/<user> | Personal files, dotfiles, application configs |
/etc | System configuration (custom sources, cron jobs, etc.) |
/root | Root user configuration |
/opt | Manually installed software |
Full Ubuntu Backupโ
Create a compressed archive of the entire Ubuntu rootfs. Run this from Termux --- not from inside the proot session:
tar czf /sdcard/adl-ubuntu-backup-$(date +%Y%m%d).tar.gz -C $PREFIX/var/lib/proot-distro/installed-rootfs/ubuntu .Full backups can be large --- several gigabytes depending on what you have installed. Make sure you have enough free space on your device before running this.
Home Directory Onlyโ
For a lighter backup that captures just your personal files and configs:
proot-distro login ubuntu -- tar czf /sdcard/adl-home-backup-$(date +%Y%m%d).tar.gz -C /home .Termux Backupโ
Back up your Termux environment separately:
tar czf /sdcard/adl-termux-backup-$(date +%Y%m%d).tar.gz -C $PREFIX .Restoring from Backupโ
To restore a full Ubuntu backup after a fresh proot-distro install ubuntu:
tar xzf /sdcard/adl-ubuntu-backup-YYYYMMDD.tar.gz -C $PREFIX/var/lib/proot-distro/installed-rootfs/ubuntuReplace YYYYMMDD with the actual date stamp of your backup file.
A full restore replaces system files, so it works best when restoring onto the same Ubuntu version. If you have upgraded Ubuntu since the backup was made, prefer restoring only the home directory.
To restore just the home directory:
proot-distro login ubuntu -- tar xzf /sdcard/adl-home-backup-YYYYMMDD.tar.gz -C /homeComplete Fresh Startโ
This is the nuclear option. It removes Termux, all proot distros, and all data stored within them. Only do this if nothing else has worked.
Step 1 --- Back Up Everything You Care Aboutโ
Copy important files to /sdcard or another location outside Termux:
cp -r ~/important-files /sdcard/adl-rescue/Step 2 --- Remove All Proot Distrosโ
proot-distro remove ubuntuStep 3 --- Clear Termux Dataโ
Open Android Settings, navigate to Apps, find Termux, and tap "Clear Data." This removes all Termux files, packages, and configuration.
Alternatively, uninstall and reinstall the Termux app entirely.
Step 4 --- Start Overโ
Follow the installation guides from the beginning:
Common Recovery Scenariosโ
Recovering from a Broken Package Databaseโ
A corrupted or locked package database can prevent you from installing, removing, or upgrading any packages. This section covers how to fix dpkg and apt when they refuse to cooperate.
Lock File Errorsโ
If apt or dpkg reports that another process is using the database, or that a lock file exists:
sudo rm -f /var/lib/dpkg/lock-frontend /var/lib/dpkg/lock /var/cache/apt/archives/locksudo dpkg --configure -aOnly remove lock files if you are certain no other package operation is running. Removing a lock while dpkg is actively working can corrupt the package database further.
Interrupted dpkg Configurationโ
If a previous install or upgrade was interrupted (power loss, Termux killed, forced exit), packages may be in a half-configured state:
sudo dpkg --configure -aIf that fails with errors about specific packages, force-remove the broken package and reinstall it:
sudo dpkg --remove --force-remove-reinstreq <package-name>sudo apt install -fCorrupted Package Listsโ
If apt update fails with parsing errors or complaints about malformed package lists:
sudo rm -rf /var/lib/apt/lists/*sudo apt cleansudo apt updateThis removes all cached package metadata and forces apt to download fresh copies from the repositories.
Rebuilding the dpkg Databaseโ
In rare cases, the dpkg status file itself can become corrupted. A backup is maintained automatically:
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/statussudo dpkg --configure -aIf neither the status file nor its backup is usable, you can attempt to rebuild the available packages list:
sudo dpkg --clear-availsudo apt updateIf the dpkg database is severely corrupted and none of these steps work, you may need to reset the Ubuntu installation entirely. See the Reset Ubuntu Without Losing Termux section above. Back up your home directory first.
Fixing Broken Dependenciesโ
When packages have unsatisfied dependencies, use apt's built-in repair:
sudo apt install -fIf that does not resolve the issue, try removing and reinstalling the problematic packages:
sudo apt purge <broken-package> && sudo apt autoremove -y && sudo apt install <broken-package>Before attempting any recovery, always try the least destructive option first: restart the VNC session, reinstall a single package, or clear a config directory. Move to broader resets only when targeted fixes have failed.