Kali Linux Update Recovery Log: Post‐I O Error & Dependency Deadlock - kdaisho/Blog GitHub Wiki
date: 2026-04-11
Overview
System encountered a Read-Only (RO) file system error during a full-upgrade, leading to a corrupted dpkg database and broken dependencies. This was further complicated by a file conflict in the pyinstaller-hooks-contrib package.
Phase 1: Filesystem & Graphical Reset
When the SSD locks into Read-Only mode due to kernel-detected errors, the system must be forced back to Read-Write to allow repairs.
- Remount Filesystem:
sudo mount -o remount,rw / - Clear X11 Locks: (Fixed the issue where the GUI wouldn't start)
sudo rm /tmp/.X11-unix/X0sudo rm ~/.Xauthority - Set Boot Target: Ensured the system boots to the desktop.
sudo systemctl set-default graphical.target
Phase 2: Resolving the Dependency Deadlock
The upgrade stalled on a file conflict where two packages claimed the same Python __init__.py file.
- Manual Metadata Cleanup: Removed the "ghost" directory preventing the new package from installing.
sudo rm -rf /usr/lib/python3/dist-packages/pyinstaller_hooks_contrib-*.dist-info/ - Database Purge: Forced the
dpkgdatabase to forget the conflicting old package.sudo dpkg --purge --force-all python3-pyinstaller-hooks-contrib - Repair Command:
sudo apt --fix-broken install
Phase 3: Finalizing the Upgrade
Once the "knot" was untied, the standard update path was cleared.
- Finish Configurations:
sudo dpkg --configure -a - Complete Upgrade:
sudo apt full-upgrade -y - Ensure Desktop Integrity:
sudo apt install kali-linux-default - Hardware Sync:
sync(Ensures all data is physically written to the SSD before reboot).
Phase 4: Post-Repair Verification
Before proceeding with high-load projects like Project Nomad, verify the environment:
- Package Health:
dpkg -l | grep ^iU(Should return nothing). - GPU Status:
nvidia-smi(Must show Driver 550.x and the RTX 3060).
Note: If
dpkgcomplains about "unknown options" like-odespite not typing them, check for single-dash vs. double-dash typos (e.g.,-configurevs--configure). If errors persist, check the SSD for hardware failure usingjournalctl -p 3 -xb.